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

A006899 Numbers of the form 2^i or 3^j.

Original entry on oeis.org

1, 2, 3, 4, 8, 9, 16, 27, 32, 64, 81, 128, 243, 256, 512, 729, 1024, 2048, 2187, 4096, 6561, 8192, 16384, 19683, 32768, 59049, 65536, 131072, 177147, 262144, 524288, 531441, 1048576, 1594323, 2097152, 4194304, 4782969, 8388608, 14348907, 16777216, 33554432
Offset: 1

Views

Author

Keywords

Comments

Complement of A033845 with respect to A003586. - Reinhard Zumkeller, Sep 25 2008
In the 14th century, Levi Ben Gerson proved that the only pairs of terms which differ by 1 are (1, 2), (2, 3), (3, 4), and (8, 9); see A235365, A235366, A236210. - Jonathan Sondow, Jan 20 2014
Numbers n such that absolute value of the greatest prime factor of n minus the smallest prime not dividing n is 1 (that is, abs(A006530(n)-A053669(n)) = 1). - Anthony Browne, Jun 26 2016
Deficient 3-smooth numbers, i.e., intersection of A005100 and A003586. - Amiram Eldar, Jun 03 2022

References

  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 78.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Union of A000079 and A000244. - Reinhard Zumkeller, Sep 25 2008
A186927 and A186928 are subsequences.
Cf. A108906 (first differences), A006895, A227928.

Programs

  • Haskell
    a006899 n = a006899_list !! (n-1)
    a006899_list = 1 : m (tail a000079_list) (tail a000244_list) where
       m us'@(u:us) vs'@(v:vs) = if u < v then u : m us vs' else v : m us' vs
    -- Reinhard Zumkeller, Oct 09 2013
    
  • Maple
    A:={seq(2^n,n=0..63)}: B:={seq(3^n,n=0..40)}: C:=sort(convert(A union B,list)): seq(C[j],j=1..39); # Emeric Deutsch, Aug 03 2005
  • Mathematica
    seqMax = 10^20; Union[2^Range[0, Floor[Log[2, seqMax]]], 3^Range[0, Floor[Log[3, seqMax]]]] (* Stefan Steinerberger, Apr 08 2006 *)
  • PARI
    is(n)=n>>valuation(n,2)==1 || n==3^valuation(n,3) \\ Charles R Greathouse IV, Aug 29 2016
    
  • PARI
    upto(n) = my(res = vector(logint(n, 2) + logint(n, 3) + 1), t = 1); res[1] = 1; for(i = 2, 3, for(j = 1, logint(n, i), t++; res[t] = i^j)); vecsort(res) \\ David A. Corneth, Oct 26 2017
    
  • PARI
    a(n) = my(i0= logint(3^(n-1),6), i= logint(3^n,6)); if(i > i0, 2^i, my(j=logint(2^n,6)); 3^j) \\ Ruud H.G. van Tol, Nov 10 2022
    
  • Python
    from sympy import integer_log
    def A006899(n): return 1<Chai Wah Wu, Oct 01 2024

Formula

a(n) = A085239(n)^A085238(n). - Reinhard Zumkeller, Jun 22 2003
A086411(a(n)) = A086410(a(n)). - Reinhard Zumkeller, Sep 25 2008
A053669(a(n)) - A006530(a(n)) = (-1)^a(n) n > 1. - Anthony Browne, Jun 26 2016
Sum_{n>=1} 1/a(n) = 5/2. - Amiram Eldar, Jun 03 2022
a(n)^(1/n) tends to 3^(log(2)/log(6)) = 2^(log(3)/log(6)) = 1.529592328491883538... - Vaclav Kotesovec, Sep 19 2024

Extensions

More terms from Reinhard Zumkeller, Jun 22 2003

A235366 Smallest odd prime factor of 3^n - 1.

Original entry on oeis.org

13, 5, 11, 7, 1093, 5, 13, 11, 23, 5, 797161, 547, 11, 5, 1871, 7, 1597, 5, 13, 23, 47, 5, 11, 398581, 13, 5, 59, 7, 683, 5, 13, 103, 11, 5, 13097927, 1597, 13, 5, 83, 7, 431, 5, 11, 47, 1223, 5, 491, 11, 13, 5, 107, 7, 11, 5, 13, 59, 14425532687, 5, 603901, 683, 13, 5, 11, 7, 221101, 5, 13, 11
Offset: 3

Views

Author

Jonathan Sondow, Jan 19 2014

Keywords

Comments

Levi Ben Gerson (1288-1344) proved that 3^n - 1 = 2^m has no solution in integers if n > 2, by showing that 3^n - l has an odd prime factor. His proof uses remainders after division of powers of 3 by 8 and powers of 2 by 8; see the Lenstra and Peterson links. For an elegant short proof, see the Franklin link. - Sondow
One way to prove it is by the use of congruences. The powers of 3, modulo 80, are 3, 9, 27, 1, 3, 9, 27, 1, 3, 9, 27, 1, ... The powers of 2 are 2, 4, 8, 16, 32, 64, 48, 16, 32, 64, 48, 16, ... - Alonso del Arte, Jan 20 2014

Examples

			3^3 - 1 = 26 = 2 * 13, so a(3) = 13.
3^4 - 1 = 80 = 2^4 * 5, so a(4) = 5.
3^5 - 1 = 242 = 2 * 11^2, so a(5) = 11.
		

References

  • L. E. Dickson, History of the Theory of Numbers, Vol. II, Chelsea, NY 1992; see p. 731.

Crossrefs

See A235365 for 3^n + 1.
Cf. also A003586 (products 2^m * 3^n), A006899, A061987, A108906.

Programs

  • Mathematica
    Table[FactorInteger[3^n - 1][[2, 1]], {n, 3, 50}]
  • PARI
    a(n)=factor(3^n>>valuation(3^n-1,2))[1,1] \\ Charles R Greathouse IV, Jan 20 2014

Formula

a(4n) = 5 as 3^(4n)-1 = (3^4)^n-1 = 81^n-1 = (80+1)^n-1 == 0 (mod 5).
a(6+12n) = 7 as 3^(6+12n)-1 = (3^6)^(1+2n)-1 = 729^(1+2n)-1 = (728+1)^(1+2n)-1 == 1^(1+2n)-1 == 0 (mod 7), but 729^(1+2n)-1 = (730-1)^(1+2n)-1 == (-1)^(1+2n)-1 == -2 (mod 5).

A235365 Smallest odd prime factor of 3^n + 1, for n > 1.

Original entry on oeis.org

5, 7, 41, 61, 5, 547, 17, 7, 5, 67, 41, 398581, 5, 7, 21523361, 103, 5, 2851, 41, 7, 5, 23535794707, 17, 61, 5, 7, 41, 523, 5, 6883, 926510094425921, 7, 5, 61, 41, 18427, 5, 7, 17, 33703, 5, 82064241848634269407, 41, 7, 5, 16921, 76801, 547, 5, 7, 41, 78719947, 5, 61, 17, 7, 5, 3187, 41
Offset: 2

Views

Author

Jonathan Sondow, Jan 19 2014

Keywords

Comments

Levi Ben Gerson (1288-1344) proved that 3^n + 1 = 2^m has no solution in integers if n > 1, by showing that 3^n + l has an odd prime factor. His proof uses remainders after division of powers of 3 by 8 and powers of 2 by 8; see the Lenstra and Peterson links. For an elegant short proof, see the Franklin link.

Examples

			3^2 + 1 = 10 = 2*5, so a(2) = 5.
		

References

  • L. E. Dickson, History of the Theory of Numbers, Vol. II, Chelsea, NY 1992; see p. 731.

Crossrefs

See A235366 for 3^n - 1.
Cf. also A003586 (products 2^m * 3^n), A006899, A061987, A108906.

Programs

  • Magma
    [PrimeDivisors(3^n +1)[2]: n in [2..60] ] ; // Vincenzo Librandi, Mar 16 2019
  • Mathematica
    Table[FactorInteger[3^n + 1][[2, 1]], {n, 2, 50}]

Formula

a(2+4n) = 5 as 3^(2+4n) + 1 = (3^2)*(3^4)^n + 1 = 9*81^n + 1 = 9*(80+1)^n + 1 == 9 + 1 == 0 (mod 5).
a(3+6n) = 7 as 3^(3+6n) + 1 = (3^3)*(3^6)^n + 1 = 27*729^n + 1 = 27*(728+1)^n + 1 == 27 + 1 == 0 (mod 7), but 27 * 729^n + 1 == 2*(-1)^n + 1 !== 0 (mod 5).

Extensions

Terms to a(132) in b-file from Vincenzo Librandi, Mar 16 2019
a(133)-a(658) in b-file from Amiram Eldar, Feb 05 2020
a(659)-a(768) in b-file from Max Alekseyev, Apr 27 2022

A236210 Pairs of "harmonic numbers" 2^m * 3^n that differ by 1.

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 8, 9
Offset: 1

Views

Author

Jonathan Sondow, Jan 20 2014

Keywords

Comments

Philippe de Vitry (1291-1361), a musician from Vitry-en-Artois in France, called numbers of the form 2^m * 3^n "harmonic numbers". He asked if all powers of 2 and 3 differ by more than 1 except the pairs 1 and 2, 2 and 3, 3 and 4, 8 and 9 (which correspond to musically significant ratios, representing an octave, fifth, fourth, and whole tone). Levi Ben Gerson (1288-1344) answered yes by proving that 3^n +- 1 is not a power of 2 if n > 2; see A235365, A235366.

Examples

			8 + 1 = 2^3 + 1 = 3^2 = 9, so the pair 8 and 9 is in the sequence.
		

References

  • L. E. Dickson, History of the Theory of Numbers, Vol. II, Chelsea, NY 1992; see p. 731.

Crossrefs

A006895 Parenthesized one way gives the powers of 2: (1), (2), (1+3), ..., another way the powers of 3: (1), (2+1), (3+6), ....

Original entry on oeis.org

1, 2, 1, 3, 6, 2, 16, 9, 23, 58, 6, 128, 109, 147, 512, 70, 954, 1233, 815, 4096, 1650, 6542, 13141, 3243, 32768, 23038, 42498, 131072, 3577, 258567, 272874, 251414, 1048576, 294333, 1802819, 2980150, 1214154, 8388608, 4746145, 12031071, 31015650, 2538782
Offset: 0

Views

Author

N. J. A. Sloane, K. S. Brown [ kevin2003(AT)delphi.com ]

Keywords

Comments

Powers of 2 need 1 term or 2 terms parenthesized, whereas powers of 3 need 2 or 3 terms parenthesized, when 3 then the middle term is a power of 2. See A227928. - Reinhard Zumkeller, Oct 09 2013

Examples

			.  a(0)                                              =  _^0
.  a(1)                                              =  2^1
.  a(1) + a(2)            =    2 +   1               =  3^1
.  a(2) + a(3)            =    1 +   3        =    4 =  2^2
.  a(3) + a(4)            =    3 +   6        =    9 =  3^2
.  a(4) + a(5)            =    6 +   2        =    8 =  2^3
.  a(6)                                       =   16 =  2^4
.  a(5) + a(6) + a(7)     =    2 +  16 +   9  =   27 =  3^3
.  a(7) + a(8)            =    9 +  23        =   32 =  2^5
.  a(8) + a(9)            =   23 +  58        =   81 =  3^4
.  a(9) + a(10)           =   58 +   6        =   64 =  2^6
.  a(11)                                      =  128 =  2^7
.  a(10) + a(11) + a(12)  =    6 + 128 + 109  =  243 =  3^5
.  a(12) + a(13)          =  109 + 147        =  256 =  2^8
.  a(14)                                      =  512 =  2^9
.  a(13) + a(14) + a(15)  =  147 + 512 +  70  =  3^6 =  729 .
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006895 n = a006895_list !! n
    a006895_list = 1 : f 0 0 (tail a000079_list) (tail a000244_list) where
       f x y us'@(u:us) vs'@(v:vs)
         | x > 0     = (u - x) : f 0 (u - x + y) us vs'
         | y > v - u = (v - y) : f (v + x - y) 0 us' vs
         | otherwise =       u : f 0 (u + y) us vs'
    -- Reinhard Zumkeller, Oct 09 2013

A364902 Let x, y be the greatest exponents of 2, 3 respectively such that 2^x, 3^y do not exceed n and let k_2, k_3 be n - 2^x, and n - 3^y respectively. Then for n such that k_2 = 0 or k_3 = 0, a(n) = n, else a(n) is the least novel number Min{p*a(k_2), q*a(k_3)}, where p, q are primes not equal to either 2 or 3.

Original entry on oeis.org

1, 2, 3, 4, 5, 10, 15, 8, 9, 7, 14, 20, 25, 35, 50, 16, 11, 22, 21, 28, 55, 70, 75, 40, 45, 49, 27, 13, 26, 33, 44, 32, 17, 34, 39, 52, 65, 98, 100, 56, 63, 77, 80, 121, 110, 105, 140, 112, 143, 154, 147, 196, 245, 135, 91, 130, 165, 220, 160, 85, 170, 195, 260, 64, 19, 38, 51, 68
Offset: 1

Views

Author

Keywords

Comments

Motivated by the recursion D(2) known to reproduce A005940, this sequence uses a compound version based on a squarefree semiprime (6) rather than a prime, in which the terms are generated by a greedy algorithm related to the distances between n and the greatest powers of 2, and 3 not exceeding n. After a(9) = 9 each power of 2 or 3 is followed by the smallest prime not yet in the sequence. (e.g. 11 follows 16, 13 follows 27, etc).
There are no multiples of 6 in this sequence.
For k > 2, if a(i) = prime(k) = p and a(j) = p^2 then j-i is a term in A006899 (e.g. a(17) = 11, a(44) = 121 and 44 - 17 = 27 = 3^3).
Conjectures: (i). This is a permutation of A047253 with primes in order; (ii). All terms between consecutive prime terms, prime(k), prime(k+1) are prime(k)-smooth.

Examples

			a(n) = n for n <= 4 because all such n are powers of 2 or 3.
a(5) = least novel Min{a(1)*p,a(2)*q} = Min{p,2*q} for o,q prime != 2 or 3, so a(5) = 5.
17=16+1=9+8, so a(17) = least novel Min{a(1)*p,a(8)*q} = Min{p,8*q} = 11.
Data can be shown in tabular form in two distinct ways: First row starts with 1 and then rows start with a prime; alternatively each row starts with 2^i or 3^j:
 1;                       1;
 2;                       2;
 3,4;                     3;
 5,10,15,8,9;             4,5,10,15;
 7,14,20,25,35,50,16;     8;
 11,22,21,28,55...        9,7,14,20,25,35,50
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[_] = False; s = {1, 2}; w = Length[s]; t = Prime[s]; flag = 0;
    Array[Set[{q[#1], p[#1],
          r[#1]}, {#1, #2,
            Prepend[#2^Range[Floor@Log[#2, nn]], 1]} & @@ {#2,
           Prime[#2]}] & @@ {#, s[[#]]} &, w];
    Do[If[n == 1,
       Set[{a[n], c[1]}, {1, True}],
       Array[Set[m[#], 1] &, w];
       Array[Set[j[#], n - p[#]^(-1 + LengthWhile[r[#], # < n + 1 &])] &, w];
       Array[
        If[j[#] == 0,
          k[#] = n; flag = #,
          While[Set[k[#], Prime[m[#]] a[j[#]]];
           Or[MemberQ[s, m[#]], c[k[#]]], m[#]++]] &, w];
       If[flag > 0,
        Set[{a[n], c[k[flag]]}, {k[flag], True}]; flag = 0,
        Set[{a[n], c[#]}, {#, True}] &[Min@ Array[k, w]] ]], {n, nn}];
    Array[a, nn] (* Michael De Vlieger, Sep 24 2023 *)

Formula

For n > 6, a(A006899(n) + 1) = prime(n-2).
Showing 1-6 of 6 results.