1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #!/usr/bin/ruby
- # Numbers n such that 3^n - 2^n is not squarefree, but 3^d - 2^d is squarefree for all proper divisors d of n.
- # https://oeis.org/A280203
- func f(k) {
- k.divisors.first(-1).grep{_ < 150}.all {|d|
- #is_prob_squarefree(2**d - 1, 1e8)
- is_squarefree(3**d - 2**d)
- }
- }
- #~ From ~~~~: (Start)
- #~ The following numbers are also in the sequence: {689, 732, 776, 903, 1055, 1081, 1332, 2525, 2628, 13861}.
- #~ Probably, the following numbers are also terms: {2054, 3422, 6416, 6482, 6516, 6806, 9591, 9653, 10386, 10506, 11026, 11342, 11772, 12656, 13203, 14878, 15657, 15922}. (End)
- # Smooth 10^4
- # 10, 11, 42, 52, 57, 203, 272, 497, 689, 732, 776, 903, 1055, 1081, 1332, 2054, 2525, 2628, 3422, 6416, 6482, 6516, 6806, 9591, 9653, 10386, 10506, 11026, 11342, 11772, 12656, 13203, 13861, 14878, 15657, 15922
- # Smooth 10^7
- # 10, 11, 42, 52, 57, 203, 272, 497, 689, 732, 776, 903, 1055, 1081, 1332, 2054, 2525, 2628, 3422, 6416, 6482, 6516, 6806
- for k in (
- 6806, 9591, 9653, 10386, 10506, 11026, 11342, 11772, 12656, 13203, 13861, 14878, 15657, 15922,
- ) {
- var t = (3**k - 2**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(3**d - 2**d)
- }
- }
- for k in (1..30000
- ) {
- var t = (3**k - 2**k)
- if (!t.is_prob_squarefree(1e6) && !t.is_prob_squarefree && f(k)) {
- print(k, ", ")
- }
- }
- 6, 20, 21, 110, 136, 155, 253, 364, 602, 657, 812, 889, 979, 1081,
|