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-8 of 8 results.

A376699 Positions of primes in the sequence of numbers of the form 2^i * 3^j - 1 (A069353).

Original entry on oeis.org

3, 4, 5, 6, 8, 10, 11, 13, 15, 16, 18, 21, 22, 25, 31, 32, 36, 39, 40, 42, 51, 57, 61, 63, 65, 66, 71, 73, 79, 82, 94, 97, 106, 107, 110, 120, 121, 127, 128, 129, 130, 138, 142, 144, 161, 192, 204, 205, 212, 216, 232, 234, 244, 259, 264, 265, 308, 329, 346, 348
Offset: 1

Views

Author

Amiram Eldar, Oct 02 2024

Keywords

Crossrefs

Programs

  • Mathematica
    With[{lim = 10^10}, Position[Sort@ Flatten@ Table[2^i*3^j - 1, {i, 0, Log2[lim]}, {j, 0, Log[3, lim/2^i]}], _?PrimeQ] // Flatten]
  • PARI
    lista(lim) = {my(s = List()); for(i = 0, logint(lim, 2), for(j = 0, logint(lim >> i, 3), listput(s, 2^i * 3^j - 1))); s = Set(s); for(i = 1, #s, if(isprime(s[i]), print1(i, ", ")));}
    
  • Python
    from itertools import count, islice
    from sympy import isprime, integer_log
    def A069353(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x+1)//3**i).bit_length() for i in range(integer_log(x+1,3)[0]+1))
        return bisection(f,n-1,n-1)
    def A376699_gen(): # generator of terms
        return filter(lambda n:isprime(A069353(n)), count(1))
    A376699_list = list(islice(A376699_gen(),30)) # Chai Wah Wu, Mar 31 2025

Formula

A069353(a(n)) = A003586(a(n)) - 1 = A005105(n).

A005105 Class 1+ primes: primes of the form 2^i*3^j - 1 with i, j >= 0.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 23, 31, 47, 53, 71, 107, 127, 191, 383, 431, 647, 863, 971, 1151, 2591, 4373, 6143, 6911, 8191, 8747, 13121, 15551, 23327, 27647, 62207, 73727, 131071, 139967, 165887, 294911, 314927, 442367, 472391, 497663, 524287, 786431, 995327
Offset: 1

Views

Author

Keywords

Comments

The definition is given by Guy: a prime p is in class 1+ if the only prime divisors of p + 1 are 2 or 3; and p is in class r+ if every prime factor of p + 1 is in some class <= r+ - 1, with equality for at least one prime factor. - N. J. A. Sloane, Sep 22 2012
See A005109 for the definition of class r- primes.
Odd terms are primes satisfying p==-1 (mod phi(p+1)). - Benoit Cloitre, Feb 22 2002
These are the primes p for which p+1 is 3-smooth. Primes for which either p+1 or p-1 have many small factors are more easily proved prime, so most of the largest primes found have this property. - Michael B. Porter, Feb 19 2013
For n>1, x=2*a(n) is a solution to the equation phi(sigma(x)) = x-phi(x). Also all Mersenne primes are in the sequence. - Jahangeer Kholdi, Sep 28 2014

Examples

			23 is in the sequence since 23 is prime and 23 + 1 = 24 = 2^3 * 3 has all prime factors less than or equal to 3.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    A:=Filtered([1..10^7],IsPrime);;     I:=[3];;
    B:=List(A,i->Elements(Factors(i+1)));;
    C:=List([0..Length(I)],j->List(Combinations(I,j),i->Concatenation([2],i)));;
    A005105:=Concatenation([2],List(Set(Flat(List([1..Length(C)],i->List([1..Length(C[i])],j->Positions(B,C[i][j]))))),i->A[i])); # Muniru A Asiru, Sep 28 2017
    
  • Magma
    [p: p in PrimesUpTo(6*10^6) | forall{d: d in PrimeDivisors(p+1) | d le 3}]; // Bruno Berselli, Sep 24 2012
    
  • Maple
    For Maple program see Mathar link.
    # Alternative:
    N:= 10^6: # to get all terms <= N
    select(isprime,{seq(seq(2^i*3^j-1, i=0..ilog2(N/3^j)), j=0..floor(log[3](N)))});
    # if using Maple 11 or earlier, uncomment the following line
    # sort(convert(%,list));  # Robert Israel, Sep 28 2014
  • Mathematica
    mx = 10^6; Select[ Sort@ Flatten@ Table[2^i*3^j - 1, {i, 0, Log[2, mx]}, {j, 0, Log[3, mx/2^i]}], PrimeQ] (* or *)
    Prime[ Select[ Range[78200], Mod[ Prime[ # ] + 1, EulerPhi[ Prime[ # ] + 1]] == 0 &]] (* or *)
    PrimeFactors[n_Integer] := Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] + 1]]; ClassPlusNbr[n_] := Length[ NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[3, 78200], ClassPlusNbr[ Prime[ # ]] == 1 &]]
  • PARI
    list(lim)=my(v=List(), N); lim=1+lim\1; for(n=0, logint(lim,3), N=3^n; while(N<=lim, if(ispseudoprime(N-1),listput(v, N-1)); N<<=1)); Set(v) \\ Charles R Greathouse IV, Jul 15 2011; corrected Sep 22 2015
    
  • Python
    from itertools import count, islice
    from sympy import integer_log, isprime
    def A069353(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x+1)//3**i).bit_length() for i in range(integer_log(x+1,3)[0]+1))
        return bisection(f,n-1,n-1)
    def A005105_gen(): # generator of terms
        return filter(lambda n:isprime(n), map(A069353,count(1)))
    A005105_list = list(islice(A005105_gen(),30)) # Chai Wah Wu, Mar 31 2025

Formula

{primes p : A126433(PrimePi(p)) = 1 }. - R. J. Mathar, Sep 24 2012

Extensions

More terms from Benoit Cloitre, Feb 22 2002
Edited and extended by Robert G. Wilson v, Mar 20 2003

A190803 Increasing sequence generated by these rules: a(1)=1, and if x is in a then 2x-1 and 3x-1 are in a.

Original entry on oeis.org

1, 2, 3, 5, 8, 9, 14, 15, 17, 23, 26, 27, 29, 33, 41, 44, 45, 50, 51, 53, 57, 65, 68, 77, 80, 81, 86, 87, 89, 98, 99, 101, 105, 113, 122, 129, 131, 134, 135, 149, 152, 153, 158, 159, 161, 170, 171, 173, 177, 194, 195, 197, 201, 203, 209, 225, 230, 239, 242
Offset: 1

Views

Author

Clark Kimberling, May 25 2011

Keywords

Comments

This sequence represents a class of sequences generated by rules of the form "a(1)=1, and if x is in a then hx+i and jx+k are in a, where h,i,j,k are integers." If m>1, at least one of the numbers b(m)=(a(m)-i)/h and c(m)=(a(m)-k)/j is in the set N of natural numbers. Let d(n) be the n-th b(m) in N, and let e(n) be the n-th c(m) in N. Note that a is a subsequence of both d and e.
Examples, where [A......] indicates a conjecture:
A190803: (h,i,j,k)=(2,-1,3,-1); d=A190841, e=A190842
A190804: (h,i,j,k)=(2,-1,3,0); d=[A190803], e=A190844
A190805: (h,i,j,k)=(2,-1,3,1); d=A190845, e=[A190808]
A190806: (h,i,j,k)=(2,-1,3,2); d=[A190804], e=A190848
...
A190807: (h,i,j,k)=(2,0,3,-1); d=A190849, e=A190850
A003586: (h,i,j,k)=(2,0,3,0); d=e=A003586
A190808: (h,i,j,k)=(2,0,3,1); d=A190851, e=A190852
A190809: (h,i,j,k)=(2,0,3,2); d=A190853, e=A190854
...
A190810: (h,i,j,k)=(2,1,3,-1); d=A190855, e=A190856
A190811: (h,i,j,k)=(2,1,3,0); d=A002977, e=A190857
A002977: (h,i,j,k)=(2,1,3,1); d=A190858, e=A190859
A190812: (h,i,j,k)=(2,1,3,2); d=A069353, e=[A190812]
...
For h=j=3, see A191106; for h=3 and j=4, see A191113.

Examples

			1 -> 2 -> 3,5 -> 8,9,14 -> 15,17,23,26,27,41 -> ...
		

Crossrefs

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a190803 n = a190803_list !! (n-1)
    a190803_list = 1 : f (singleton 2)
       where f s = m : (f $ insert (2*m-1) $ insert (3*m-1) s')
                 where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Jun 01 2011
  • Mathematica
    h = 2; i = -1; j = 3; k = -1; f = 1; g = 10;
    a = Union[Flatten[NestList[{h # + i, j # + k} &, f, g]]]  (* A190803 *)
    b = (a + 1)/2; c = (a + 1)/3; r = Range[1, 300];
    d = Intersection[b, r] (* A190841 *)
    e = Intersection[c, r] (* A190842 *)
    (* Regarding this program - useful for many choices of h,i,j,k,f,g - the depth g must be chosen with care - that is, large enough.  Assuming that h<=j, the least new terms in successive nests a are typically iterates of hx+i, starting from x=1.  If, for example, h=2 and i=0, the least terms are 2,4,8,...,2^g, so that g>=9 ensures inclusion of all the desired terms <=256. *)

Extensions

a(34)=225 inserted by Reinhard Zumkeller, Jun 01 2011

A069355 Numbers of form 2^i*3^j - (i+j) with i, j >= 0.

Original entry on oeis.org

1, 2, 4, 5, 7, 9, 12, 15, 20, 24, 27, 32, 43, 50, 58, 67, 77, 90, 103, 121, 138, 157, 185, 210, 238, 248, 281, 318, 376, 425, 480, 503, 568, 641, 723, 759, 856, 965, 1014, 1143, 1288, 1451, 1526, 1719, 1936, 2037, 2180, 2294, 2583, 2908, 3061, 3446, 3879, 4084
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 18 2002

Keywords

Comments

Distinct values of A003586(m)-A069352(m) or of A069345(A003586(m)). - Michel Marcus, Apr 09 2018

Examples

			1 is a term because 2^0*3^0 - (0+0) = 2^1*3^0 - (1+0) = 1.
2 is a term because 2^2*3^0 - (2+0) = 2^0*3^1 - (0+1) = 2.
4 is a term because 2^1*3^1 - (1+1) = 4.
		

Crossrefs

Programs

  • Mathematica
    With[{nn=20},Take[Flatten[Table[2^i 3^j-i-j,{i,0,nn},{j,0,nn}]]//Union,60]] (* Harvey P. Dale, Aug 29 2022 *)

Extensions

Duplicated term 2 and incorrect formula removed by Altug Alkan, Apr 09 2018

A190812 Increasing sequence generated by these rules: a(1)=1, and if x is in a then 2x+1 and 3x+2 are in a.

Original entry on oeis.org

1, 3, 5, 7, 11, 15, 17, 23, 31, 35, 47, 53, 63, 71, 95, 107, 127, 143, 161, 191, 215, 255, 287, 323, 383, 431, 485, 511, 575, 647, 767, 863, 971, 1023, 1151, 1295, 1457, 1535, 1727, 1943, 2047, 2303, 2591, 2915, 3071, 3455, 3887, 4095, 4373, 4607, 5183, 5831, 6143, 6911, 7775, 8191, 8747, 9215, 10367, 11663
Offset: 1

Views

Author

Clark Kimberling, May 20 2011

Keywords

Comments

See A190803.

Crossrefs

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a190812 n = a190812_list !! (n-1)
    a190812_list = f $ singleton 1
       where f s = m : (f $ insert (2*m+1) $ insert (3*m+2) s')
                 where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Jun 01 2011
  • Mathematica
    h = 2; i = 1; j = 3; k = 2; f = 1; g = 20 ;
    a = Union[Flatten[NestList[{h # + i, j # + k} &, f, g]]]  (* A190812 *)
    b = (a - 1)/2; c = (a - 2)/3; r = Range[1, 30000];
    d = Intersection[b, r] (* A069353 *)
    e = Intersection[c, r] (* A190812 conjectured *)

Extensions

a(41)=2047 inserted by Reinhard Zumkeller, Jun 01 2011

A264164 3-smooth numbers whose number of divisors is not 3-smooth.

Original entry on oeis.org

16, 48, 64, 81, 144, 162, 192, 324, 432, 512, 576, 648, 729, 1024, 1296, 1458, 1536, 1728, 2592, 2916, 3072, 3888, 4096, 4608, 5184, 5832, 8192, 9216, 10368, 11664, 12288, 13824, 15552, 16384, 19683, 20736, 23328, 24576, 27648, 34992, 36864, 39366, 41472
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 19 2015

Keywords

Examples

			a(12) = 648 = 2^3*3^4 = A003586(36) and A000005(648) = 20 = 2^2*5.
a(13) = 729 = 3^6 = A003586(37) and A000005(729) = 7.
A003586(38) = 768 = 2^8*3 is not a term, as A000005(768) = 18 = 2*3^2.
		

Crossrefs

Cf. A000005, A003586, A065333, A069353, A264165 (complement with respect to A003586).

Programs

  • Haskell
    a264164 n = a264164_list !! (n-1)
    a264164_list = filter ((== 0) . a065333 . a000005') a003586_list
  • Mathematica
    smQ[n_] := n == Times @@ ({2, 3}^IntegerExponent[n, {2, 3}]);
    seq[max_] := Sort@ Flatten@ Table[If[smQ[i + 1] && smQ[j + 1], Nothing, 2^i * 3^j], {i, 0 , Log2[max]}, {j, 0, Log[3, max/2^i]}]; seq[42000] (* Amiram Eldar, Sep 03 2023 *)

Formula

A065333(a(n)) * (1 - A065333(A000005(a(n)))) = 1.
Sum_{n>=1} 1/a(n) = 3 - (Sum_{n>=1} 1/2^A069353(n)) * (Sum_{n>=1} 1/3^A069353(n)) = 0.14870906483739045152... . - Amiram Eldar, Apr 17 2025

A264165 3-smooth numbers whose number of divisors is 3-smooth.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 27, 32, 36, 54, 72, 96, 108, 128, 216, 243, 256, 288, 384, 486, 768, 864, 972, 1152, 1944, 2048, 2187, 2304, 3456, 4374, 6144, 6561, 6912, 7776, 8748, 13122, 17496, 18432, 26244, 31104, 32768, 52488, 55296, 62208, 69984
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 19 2015

Keywords

Examples

			a(25) = 768 = 2^8*3 = A003586(38) and A000005(768) = 18 = 2*3^2;
a(26) = 864 = 2^5*3^3 = A003586(39) and A000005(864) = 24 = 2^3*3;
a(27) = 972 = 2^2*3^5 = A003586(40) and A000005(972) = 18 = 2*3^2;
but A003586(41) = 1024 = 2^10 is not a term, as A000005(1024) = 11.
		

Crossrefs

Cf. A000005, A003586, A065333, A069353, A264164 (complement with respect to A003586).

Programs

  • Haskell
    a264165 n = a264165_list !! (n-1)
    a264165_list = filter ((== 1) . a065333 . a000005') a003586_list
  • Mathematica
    smQ[n_] := n == Times @@ ({2, 3}^IntegerExponent[n, {2, 3}]);
    seq[max_] := Sort@ Flatten@ Table[2^i * 3^j, {i, Select[Range[0, Floor[Log2[max]]], smQ[# + 1] &]}, {j, Select[Range[0, Floor[Log[3, max/2^i]]], smQ[# + 1] &]}]; seq[70000] (* Amiram Eldar, Sep 03 2023 *)

Formula

A065333(a(n)) * A065333(A000005(a(n))) = 1.
Sum_{n>=1} 1/a(n) = (Sum_{n>=1} 1/2^A069353(n)) * (Sum_{n>=1} 1/3^A069353(n)) = 2.85129093516260954847... . - Amiram Eldar, Apr 17 2025

A327315 Irregular triangular array read by rows: row n shows the coefficients of this polynomial of degree n: (1/n!)*(numerator of n-th derivative of (x-2)/(x^2-x+1)).

Original entry on oeis.org

-2, 1, -1, 4, -1, 1, 3, -6, 1, 2, -4, -6, 8, -1, 1, -10, 10, 10, -10, 1, -1, -6, 30, -20, -15, 12, -1, -2, 7, 21, -70, 35, 21, -14, 1, -1, 16, -28, -56, 140, -56, -28, 16, -1, 1, 9, -72, 84, 126, -252, 84, 36, -18, 1, 2, -10, -45, 240, -210, -252, 420, -120
Offset: 0

Views

Author

Clark Kimberling, Nov 01 2019

Keywords

Comments

Conjecture: The numbers n for which the n-th polynomial is irreducible are given by A069353.

Examples

			First eight rows:
  -2,   1;
  -1,   4,  -1;
   1,   3,  -6,   1;
   2,  -4,  -6,   8,  -1;
   1, -10,  10,  10, -10,   1;
  -1,  -6,  30, -20, -15,  12,  -1;
  -2,   7,  21, -70,  35,  21, -14,  1;
  -1,  16, -28, -56, 140, -56, -28, 16, -1;
First eight polynomials:
  -2 + x
  -1 + 4 x - x^2
   1 + 3 x - 6 x^2 + x^3
   2 - 4 x - 6 x^2 + 8 x^3 - x^4
   (1 + x) (1 - 11 x + 21 x^2 - 11 x^3 + x^4)
  -1 - 6 x + 30 x^2 - 20 x^3 - 15 x^4 + 12 x^5 - x^6
   (-2 + x) (1 - 3 x - 12 x^2 + 29 x^3 - 3 x^4 - 12 x^5 + x^6)
  -1 + 16 x - 28 x^2 - 56 x^3 + 140 x^4 - 56 x^5 - 28 x^6 + 16 x^7 - x^8
		

Crossrefs

Programs

  • Mathematica
    g[x_, n_] := Numerator[ Factor[D[(x - 2)/(x^2 - x + 1), {x, n}]]]
    Column[Expand[Table[g[x, n]/n!, {n, 0, 12}]]] (* A327315 polynomials *)
    h[n_] := CoefficientList[g[x, n]/n!, x];
    Table[h[n], {n, 0, 10}]  (* A327315 sequence *)
    Column[%]   (* A327315 array *)
Showing 1-8 of 8 results.