12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #!/usr/bin/ruby
- # Numbers n such that 7^n - 6^n is not squarefree, but 7^d - 6^d is squarefree for every proper divisor d of n.
- # https://oeis.org/A280307
- # Probably in the sequence:
- # 20, 26, 55, 68, 171, 258, 310, 381, 406, 506, 610, 689, 979, 1027, 1081, 1332, 3422, 3775, 3924, 4105, 4422, 4970, 5256, 5430, 5648, 5671, 6123, 6806, 8862, 9218, 9312, 9436, 9591, 9653, 10506
- #~ func f(k) {
- #~ k.divisors.first(-1).grep{_ < 150}.all {|d|
- #~ is_prob_squarefree(7**d - 6**d, 1e8)
- #~ #is_squarefree(7**d - 6**d)
- #~ }
- #~ }
- #~ for k in (1..100) {
- #~ var t = (7**k - 6**k)
- #~ if (!t.is_prob_squarefree(1e7) && f(k)) {
- #~ say k
- #~ }
- #~ else {
- #~ say "Counter-example: #{k}"
- #~ }
- #~ }
- #~ __END__
- func f(k) {
- k.divisors.first(-1).all {|d|
- is_prob_squarefree(7**d - 6**d)
- #is_squarefree(7**d - 6**d)
- }
- }
- for k in (1..30000) {
- var t = (7**k - 6**k)
- if (!t.is_prob_squarefree(1e6) && !t.is_prob_squarefree && f(k)) {
- print(k, ", ")
- }
- }
|