cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-5 of 5 results.

A097054 Nonsquare perfect powers.

Original entry on oeis.org

8, 27, 32, 125, 128, 216, 243, 343, 512, 1000, 1331, 1728, 2048, 2187, 2197, 2744, 3125, 3375, 4913, 5832, 6859, 7776, 8000, 8192, 9261, 10648, 12167, 13824, 16807, 17576, 19683, 21952, 24389, 27000, 29791, 32768, 35937, 39304, 42875, 50653
Offset: 1

Views

Author

Hugo Pfoertner, Jul 21 2004

Keywords

Comments

Terms of A001597 that are not in A000290.
All terms of this sequence are also in A070265 (odd powers), but omitting those odd powers that are also a square (e.g. 64=4^3=8^2).

Crossrefs

Cf. A001597 (perfect powers), A000290 (the squares), A008683, A070265 (odd powers), A097055, A097056, A239870, A239728, A093771.

Programs

  • Haskell
    import Data.Map (singleton, findMin, deleteMin, insert)
    a097054 n = a097054_list !! (n-1)
    a097054_list = f 9 (3, 2) (singleton 4 (2, 2)) where
       f zz (bz, be) m
        | xx < zz && even be =
                    f zz (bz, be+1) (insert (bx*xx) (bx, be+1) $ deleteMin m)
        | xx < zz = xx :
                    f zz (bz, be+1) (insert (bx*xx) (bx, be+1) $ deleteMin m)
        | xx > zz = f (zz+2*bz+1) (bz+1, 2) (insert (bz*zz) (bz, 3) m)
        | otherwise = f (zz + 2 * bz + 1) (bz + 1, 2) m
        where (xx, (bx, be)) = findMin m
    -- Reinhard Zumkeller, Mar 28 2014
    
  • Maple
    # uses code of A001597
    for n from 4 do
        if not issqr(n) and isA001597(n) then
            printf("%d,\n",n);
        end if;
    end do: # R. J. Mathar, Jan 13 2021
  • Mathematica
    nn = 50653; Select[Union[Flatten[Table[n^i, {i, Prime[Range[2, PrimePi[Log[2, nn]]]]}, {n, 2, nn^(1/i)}]]], ! IntegerQ[Sqrt[#]] &] (* T. D. Noe, Apr 19 2011 *)
  • PARI
    is(n)=ispower(n)%2 \\ Charles R Greathouse IV, Aug 28 2016
    
  • PARI
    list(lim)=my(v=List()); forprime(e=3,logint(lim\=1,2), for(b=2,sqrtnint(lim,e), if(!issquare(b), listput(v,b^e)))); Set(v) \\ Charles R Greathouse IV, Jan 09 2023
    
  • Python
    from sympy import mobius, integer_nthroot
    def A097054(n):
        def f(x): return int(n-1+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(3,x.bit_length())))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 14 2024

Formula

A052409(a(n)) is odd. - Reinhard Zumkeller, Mar 28 2014
Sum_{n>=1} 1/a(n) = 1 - zeta(2) + Sum_{k>=2} mu(k)*(1-zeta(k)) = 0.2295303015... - Amiram Eldar, Dec 21 2020

A126032 Numbers of the form b^m/2 for even b and odd m > 2.

Original entry on oeis.org

4, 16, 32, 64, 108, 256, 500, 512, 864, 1024, 1372, 2048, 2916, 3888, 4000, 4096, 5324, 6912, 8192, 8788, 10976, 13500, 16384, 19652, 23328, 27436, 32000, 37044, 42592, 48668, 50000, 55296, 62500, 65536, 70304, 78732, 87808, 97556, 108000, 119164, 124416
Offset: 1

Views

Author

Alexander Adamchuk, Feb 28 2007

Keywords

Comments

The old definition was: Numbers n such that A123669(n) = -1, or no generalized Fermat prime exists of the form (2n)^(2^k) + 1. But that sequence is probably missing a lot of terms, such as {6, 9, 11, 19, 21, 25, 26, 29, 30, 31, ...}, where no generalized Fermat prime has been found yet, and it seems unlikely any exist. Currently it can only be proved that none exist if n is of form b^m/2 for even b and odd m > 1. The listed terms are the first numbers of this form: 4 = 2^3/2, 16 = 2^5/2, 32 = 4^3/2, 64 = 2^7/2, 108 = 6^3/2, 256 = 2^9/2 = 8^3/2, 500 = 10^3/2. - Jens Kruse Andersen, Jul 24 2014
The even terms of A070265, divided by two. - Jeppe Stig Nielsen, Jul 02 2017

Crossrefs

Cf. A123669 = Smallest generalized Fermat prime of the form (2n)^(2^k) + 1, where k>0.
Cf. A070265.

Programs

  • Mathematica
    Module[{nn = 2^17, a = {}, n}, Do[If[b > nn, Break[], Do[If[Set[n, b^m/2] > nn, Break[], AppendTo[a, n]], {m, 3, Infinity, 2}]], {b, 2, Infinity, 2}]; Union@ a] (* Michael De Vlieger, Jul 04 2017 *)
  • PARI
    isOK(n)=ip=ispower(2*n);ip&&bitand(ip,ip-1) \\ Jeppe Stig Nielsen, Jul 02 2017

Extensions

Definition changed by N. J. A. Sloane, Jul 26 2014 following the advice of Jens Kruse Andersen.
Terms after a(7) from Jeppe Stig Nielsen, Jul 02 2017

A228101 a(n) is the least k such that (2n)^(2^k) + 1 is a prime; a(n) = -1 if a prime (2n)^(2^k) + 1 is unknown, or = -2 if impossible.

Original entry on oeis.org

0, 0, 0, -2, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, -2, 2, 0, -1, 0, 0, 4, 0, 2, -1, 0, 1, 1, 0, 0, -1, -2, 0, -1, 0, 0, 1, 4, 0, 2, 0, 1, -1, 0, 1, -1, 1, 0, -1, 0, 0, -1, 0, 0, 1, 0, 5, 1, 2, 1, -1, 1, 0, -2, 0, 2, 1, 0, 0, 2, 2, -1, 1, 0, 0, 3, 2, 0, 4, 1, 0, 2, 0
Offset: 1

Views

Author

Yves Gallot (galloty(AT)wanadoo.fr) and Robert G. Wilson v, Aug 14 2013

Keywords

Comments

A prime number of the form b^(2^k) + 1 is called a generalized Fermat prime to base b.
See the hyperlink for more information and links.
The impossibility case, a(n) = -2, occurs exactly if 2n is a member of A070265. Or equivalently, n is in A126032. - Jeppe Stig Nielsen, Jul 02 2017

Crossrefs

Programs

  • Mathematica
    f[b_?EvenQ] := f[b] = Block[{k = 0}, While[! PrimeQ[b^(2^k) + 1], k++]; k];
    lst = {38, 50, 62, 68, 86, 92, 98, 104, 122, 144, 168, 182, 186, 200, 202, 212, 214, 218, 244, 246, 252, 258, 286, 294, 298, 302, 304, 308, 322, 324, 338, 344, 354, 356, 362, 368, 380, 390, 394, 398, 402, 404, 410, 416, 422, 424, 446, 450, 454, 458, 468, 480, 482, 484, 500, 514, 518, 524, 528, 530, 534, 538, 552, 558, 564, 572, 574, 578, 580, 590, 602, 604, 608, 620, 622, 626, 632, 638, 648, 650, 662, 666, 668, 670, 678, 684, 692, 694, 698, 706, 712, 720, 722, 724, 734, 744, 746, 752, 754, 762, 766, 770, 792, 794, 802, 806, 812, 814, 818, 836, 840, 842, 844, 848, 854, 868, 870, 872, 878, 888, 896, 902, 904, 908, 922, 924, 926, 932, 938, 942, 944, 948, 954, 958, 964, 968, 974, 978, 980, 988, 994, 998}; (f[#] = -1) & /@ lst;
    lst = {8, 32, 64, 128, 216, 512, 1000}; (f[#] = -2) & /@ lst; Table[ f[b], {b, 2, 1000, 2}]
    (* Second program: *)
    Module[{r = 83, nn = 12, s = {}, k}, Do[If[b > r, Break[], Do[If[Set[k, b^m/2] > r, Break[], AppendTo[s, k]], {m, 3, Infinity, 2}]], {b, 2, Infinity, 2}]; Table[If[MemberQ[s, n], -2, SelectFirst[Range[0, nn], PrimeQ[(2 n)^(2^#) + 1] &] /. x_ /; MissingQ@ x -> -1], {n, r}]] (* Michael De Vlieger, Jul 04 2017, Version 10.2 *)

Extensions

Definition rewritten by Jeppe Stig Nielsen, Jul 02 2017

A253242 Least k>=0 such that n^(2^k)+1 is prime (for even n), or (n^(2^k)+1)/2 is prime (for odd n); -1 if no such k exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, -1, 0, 0, 1, 0, 0, 1, 1, 0, 2, 0, 1, 1, 0, 0, 2, 1, 0, 1, -1, 0, 1, 0
Offset: 2

Views

Author

Eric Chen, Apr 19 2015

Keywords

Comments

Least k such that the generalized Fermat number in base n (GFN(k,n)) is prime.
a(n) = -1 if n is in A070265 (perfect powers with an odd exponent).
a(n) is currently unknown for n = {31, 38, 50, 55, 62, 63, 67, 68, 77, 83, 86, 89, 91, 92, 97, 98, 99, 104, 107, 109, 122, 123, 127, 135, 137, ...}
Corresponding primes are {3, 2, 5, 3, 7, 1201, 0, 5, 11, 61, 13, 7, 197, 113, 17, 41761, 19, 181, 401, 11, 23, 139921, 577, 13, 677, 0, 29, 421, 31, ...}. (use 0 if a(n) = -1)
All 2 <= n <= 1500 and 0 <= k <= 14 are checked, the first occurrence of k (start with k = 0) in a(n) are {2, 11, 7, 43, 41, 75, 274, 234, 331, 1342, 824, ...}.

Examples

			a(7) = 2 since (7^(2^0)+1)/2 and (7^(2^1)+1)/2 are not primes, but (7^(2^2)+1)/2 = 1201 is prime.
a(14) = 1 since 14^(2^0)+1 is not prime, but 14^(2^1)+1 = 197 is prime.
		

Crossrefs

Programs

  • Mathematica
    Table[k=0; While[p=If[EvenQ[n], (2n)^(2^k)+1, ((2n)^(2^k)+1)/2]; k<12 && !PrimeQ[p], k=k+1]; If[k==12, -1, k], {n, 2, 1500}]
  • PARI
    f(n) = for(k=0, 11, if(ispseudoprime(n^(2^k)+1), return(k))); -1
    g(n) = for(k=0, 11, if(ispseudoprime((n^(2^k)+1)/2), return(k))); -1
    a(n) = if(n%2==0, f(n), g(n))
    
  • PARI
    f(n,k)=if(n%2, (n^(2^k)+1)/2, n^(2^k)+1)
    a(n)=if(ispower(-n), -1, my(k); while(!ispseudoprime(f(n,k)), k++); k) \\ Charles R Greathouse IV, Apr 20 2015

Formula

a(2n) = A228101(n) = log_2(A079706(n)).
a(A006093(n)) = 0, a(A076274(n)) = 0, a(A070265(n)) = -1.

A375888 Rectangular array: row n shows all k such that n is the number of rises in the trajectory of k in the Collatz problem.

Original entry on oeis.org

1, 2, 5, 4, 10, 3, 8, 20, 6, 17, 16, 21, 12, 34, 11, 32, 40, 13, 35, 22, 7, 64, 42, 24, 68, 23, 14, 9, 128, 80, 26, 69, 44, 15, 18, 25, 256, 84, 48, 70, 45, 28, 19, 49, 33, 512, 85, 52, 75, 46, 29, 36, 50, 65, 43, 1024, 160, 53, 136, 88, 30, 37, 51, 66, 86, 57
Offset: 0

Views

Author

Clark Kimberling, Sep 11 2024

Keywords

Comments

Assuming that the Collatz conjecture (also known as the 3x+1 conjecture) is true, this is a permutation of the positive integers; viz., every positive integer occurs exactly once. Conjecture: every row contains a pair of consecutive integers.

Examples

			Corner:
   1     2     4     8    16    32    64   128   256   512  1024
   5    10    20    21    40    42    80    84    85   160   168
   3     6    12    13    24    26    48    52    53    96   104
  17    34    35    68    69    70    75   136   138   140   141
  11    22    23    44    45    46    88    90    92    93   176
   7    14    15    28    29    30    56    58    60    61   112
   9    18    19    36    37    38    72    74    76    77    81
6 is in row 2 because the trajectory, (6, 3, 10, 5, 16, 4, 2, 1), has exactly 2 rises: 3 to 10, and 5 to 16.
		

Crossrefs

Cf. A000027, A000079 (row 1), A092893 (column 1), A006667, A070265, A078719.
Cf. A354236.

Programs

  • Mathematica
    t = Table[Count[Differences[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]], ? Positive], {n, 2048}]; (* after _Harvey P. Dale, A006667 *)
    r[n_] := Flatten[Position[t, n - 1]];
    Column[Table[r[n], {n, 1, 21}]] (* array *)
    u = Table[r[k][[n + 1 - k]], {n, 1, 12}, {k, 1, n}]
    Flatten[u] (* sequence *)

Formula

Transpose of the array in A354236.
Showing 1-5 of 5 results.