12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #!/usr/bin/ruby
- # Numbers n such that 5^n - 4^n is not squarefree, but 5^d - 4^d is squarefree for every proper divisor d of n.
- # https://oeis.org/A280209
- # Probably in the sequence:
- # 2, 55, 171, 183, 203, 465, 955, 1027, 1711, 2485, 3197, 4431, 6275, 8515, 10121,
- #~ func f(k) {
- #~ k.divisors.first(-1).grep{_ < 150}.all {|d|
- #~ is_prob_squarefree(5**d - 4**d, 1e8)
- #~ #is_squarefree(5**d - 4**d)
- #~ }
- #~ }
- #~ for k in (1..100) {
- #~ var t = (5**k - 4**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(5**d - 4**d)
- #is_squarefree(5**d - 4**d)
- }
- }
- for k in (1..30000) {
- var t = (5**k - 4**k)
- if (!t.is_prob_squarefree(1e6) && !t.is_prob_squarefree && f(k)) {
- print(k, ", ")
- }
- }
|