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.

A001047 a(n) = 3^n - 2^n.

Original entry on oeis.org

0, 1, 5, 19, 65, 211, 665, 2059, 6305, 19171, 58025, 175099, 527345, 1586131, 4766585, 14316139, 42981185, 129009091, 387158345, 1161737179, 3485735825, 10458256051, 31376865305, 94134790219, 282412759265, 847255055011, 2541798719465, 7625463267259, 22876524019505
Offset: 0

Views

Author

Keywords

Comments

a(n+1) is the sum of the elements in the n-th row of triangle pertaining to A036561. - Amarnath Murthy, Jan 02 2002
Number of 2 X n binary arrays with a path of adjacent 1's and no path of adjacent 0's from top row to bottom row. - R. H. Hardin, Mar 21 2002
With offset 1, partial sums of A027649. - Paul Barry, Jun 24 2003
Number of distinct lines through the origin in the n-dimensional lattice of side length 2. A049691 has the values for the 2-dimensional lattice of side length n. - Joshua Zucker, Nov 19 2003
a(n+1)/(n+1)=(3*3^n-2*2^n)/(n+1) is the second binomial transform of the harmonic sequence 1/(n+1). - Paul Barry, Apr 19 2005
a(n+1) is the sum of n-th row of A036561. - Reinhard Zumkeller, May 14 2006
The sequence gives the sum of the lengths of the segments in Cantor's dust generating sequence up to the i-th step. Measurement unit = length of the segment of i-th step. - Giorgio Balzarotti, Nov 18 2006
Let T be a binary relation on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xTy if x is a proper subset of y. Then a(n) = |T|. - Ross La Haye, Dec 22 2006
From Alexander Adamchuk, Jan 04 2007: (Start)
a(n) is prime for n in A057468.
p divides a(p) - 1 for prime p.
Quotients (3^p - 2^p - 1)/p, where p = prime(n), are listed in A127071.
Numbers k such that k divides 3^k - 2^k - 1 are listed in A127072.
Pseudoprimes in A127072(n) include all powers of primes {2,3,7} and some composite numbers that are listed in A127073, which includes all Carmichael numbers A002997.
Numbers n such that n^2 divides 3^n - 2^n - 1 are listed in A127074.
5 divides a(2n).
5^2 divides a(2*5n).
5^3 divides a(2*5^2n).
5^4 divides a(2*5^3n).
7^2 divides a(6*7n).
13 divides a(4n).
13^2 divides a(4*13n).
19 divides a(3n).
19^2 divides a(3*19n).
23^2 divides a(11n).
23^3 divides a(11*23n).
23^4 divides a(11*23^2n).
29 divides a(7n).
p divides a((p-1)n) for prime p>3.
p divides a((p-1)/2) for prime p in A097934. Also primes p such that 6 is a square mod p, except {2,3}, A038876(n).
p^(k+1) divides a(p^k*(p-1)/2*n) for prime p in A097934.
p^(k+1) divides a(p^k*(p-1)*n) for prime p>3.
Note the exception that for p = 23, p^(k+2) divides a(p^k*(p-1)/2*n).
There are no more such exceptions for primes p up to 600000. (End)
a(n) divides a(q*(n+1)-1), for all q integer. Leonardo Sarasua, Apr 15 2024
Final digits of terms follow sequence 1,5,9,5. - Enoch Haga, Nov 26 2007
This is also the second column sequence of the Sheffer triangle A143494 (2-restricted Stirling2 numbers). See the e.g.f. given below. - Wolfdieter Lang, Oct 08 2011
Partial sums give A000392. - Jon Perry, Apr 05 2014
For n >= 1, this is also row 2 of A281890: when consecutive positive integers are written as a product of primes in nondecreasing order, "3" occurs in n-th position a(n) times out of every 6^n. - Peter Munn, May 17 2017
a(n) is the number of ternary sequences of length n which include the digit 2. For example, a(2)=5 since the sequences are 02,20,12,21,22. - Enrique Navarrete, Apr 05 2021
a(n-1) is the number of ways we can form disjoint unions of two nonempty subsets of [n] such that the union contains n. For example, for n = 3, a(2) = 5 since the disjoint unions are {1}U{3}, {1}U{2,3}, {2}U{3}, {2}U{1,3}, and {1,2}U{3}. Cf. A000392 if we drop the requirement that the union contains n. - Enrique Navarrete, Aug 24 2021
Configures as a composite Koch Snowflake Fractal (see illustration in links) based on the five-fold division of the Cantor Square/Cantor Dust Fractal of (9^n-4^n)/5 see my illustration in (A016153). - John Elias, Oct 13 2021
Number of pairs (A,B) where B is a subset of {1,2,...,n} and A is a proper subset of B. - Jianing Song, Jun 18 2022
From Manfred Boergens, Mar 29 2023: (Start)
With regard to the comments by Ross La Haye and Jianing Song: Omitting "proper" gives A000244.
Number of pairs (A,B) where B is a nonempty subset of {1,2,...,n} and A is a nonempty subset of B. For nonempty proper subsets see a(n+1) in A028243. (End)
a(n) is the number of n-digit numbers whose smallest decimal digit is 7. - Stefano Spezia, Nov 15 2023
a(n-1) is the number of all possible player-reduced binary games observed by each player in an nx2 game assuming the individual strategies of k < n - 1 players are fixed and the remaining n - k - 1 player will play as one, either maintaining their status quo strategies or jointly adopting an alternative strategy. - Ambrosio Valencia-Romero, Apr 11 2024

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 86-87.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) = row sums of A091913, row 2 of A047969, column 1 of A090888 and column 1 of A038719.
Cf. partitions: A241766, A241759.
A diagonal of A262307.

Programs

  • Haskell
    a001047 n = a001047_list !! n
    a001047_list = map fst $ iterate (\(u, v) -> (3 * u + v, 2 * v)) (0, 1)
    -- Reinhard Zumkeller, Jun 09 2013
  • Magma
    [3^n - 2^n: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Maple
    seq(3^n - 2^n, n=0..40); # Giorgio Balzarotti, Nov 18 2006
    A001047:=1/(3*z-1)/(2*z-1); # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[ 3^n - 2^n, {n, 0, 25} ]
    LinearRecurrence[{5, -6}, {0, 1}, 25] (* Harvey P. Dale, Aug 18 2011 *)
    Numerator@NestList[(3#+1)/2&,1/2,100] (* Zak Seidov, Oct 03 2011 *)
  • PARI
    {a(n) = 3^n - 2^n};
    
  • Python
    [3**n - 2**n for n in range(25)] # Ross La Haye, Aug 19 2005; corrected by David Radcliffe, Jun 26 2016
    
  • Sage
    [lucas_number1(n, 5, 6) for n in range(26)]  # Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: x/((1-2*x)*(1-3*x)).
a(n) = 5*a(n-1) - 6*a(n-2).
a(n) = 3*a(n-1) + 2^(n-1). - Jon Perry, Aug 23 2002
Starting 0, 0, 1, 5, 19, ... this is 3^n/3 - 2^n/2 + 0^n/6, the binomial transform of A086218. - Paul Barry, Aug 18 2003
a(n) = A083323(n)-1 = A056182(n)/2 = (A002783(n)-1)/2 = (A003063(n+2)-A003063(n+1))/2. - Ralf Stephan, Jan 12 2004
Binomial transform of A000225. - Ross La Haye, Feb 07 2005
a(n) = Sum_{k=0..n-1} binomial(n, k)*2^k. - Ross La Haye, Aug 20 2005
a(n) = 2^(2n) - A083324(n). - Ross La Haye, Sep 10 2005
a(n) = A112626(n, 1). - Ross La Haye, Jan 11 2006
E.g.f.: exp(3*x) - exp(2*x). - Mohammad K. Azarian, Jan 14 2009
a(n) = A217764(n,1). - Ross La Haye, Mar 27 2013
a(n) = 2*a(n-1) + 3^(n-1). - Toby Gottfried, Mar 28 2013
a(n) = A000244(n) - A000079(n). - Omar E. Pol, Mar 28 2013
a(n) = Sum_{k=0..2} Stirling1(2,k)*(k+1)^n = c_2^{(-n)}, poly-Cauchy numbers. - Takao Komatsu, Mar 28 2013
a(n) = A227048(n,A098294(n)). - Reinhard Zumkeller, Jun 30 2013
a(n+1) = Sum_{k=0..n} 2^k*3^(n-k). - J. M. Bergot, Mar 27 2018
Sum_{n>=1} 1/a(n) = A329064. - Amiram Eldar, Nov 20 2020
a(n) = (1/2)*Sum_{k=0..n} binomial(n, k)*(2^(n-k) + 2^k - 2).
a(n) = A001117(n) + 2*A000918(n) + 1. - Ambrosio Valencia-Romero, Mar 08 2022
a(n) = A000225(n) + A028243(n+1). - Ambrosio Valencia-Romero, Mar 09 2022
From Peter Bala, Jun 27 2025: (Start)
exp(Sum_{n >=1} a(2*n)/a(n)*x^n/n) = Sum_{n >= 0} a(n+1)*x^n.
exp(Sum_{n >=1} a(3*n)/a(n)*x^n/n) = 1 + 19*x + 247*x^2 + ... is the g.f. of A019443.
exp(Sum_{n >=1} a(4*n)/a(n)*x^n/n) = 1 + 65*x + 2743*x^2 + ... is the g.f. of A383754.
The following are all examples of telescoping series:
Sum_{n >= 1} 6^n/(a(n)*a(n+1)) = 2, since 6^n/(a(n)*a(n+1)) = b(n) - b(n+1), where b(n) = 2^n/a(n);
Sum_{n >= 1} 18^n/(a(n)*a(n+1)*a(n+2)) = 22/75, since 18^n/(a(n)*a(n+1)*a(n+2)) = c(n) - c(n+1), where c(n) = (5*6^n - 2*4^n)/(15*a(n)*a(n+1));
Sum_{n >= 1} 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = 634/48735 since 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = d(n) - d(n+1), where d(n) = (57*18^n - 38*12^n + 8*8^n)/(513*a(n)*a(n+1)*a(n+2)).
Sum_{n >= 1} 6^n/(a(n)*a(n+2)) = 14/25; Sum_{n >= 1} (-6)^n/(a(n)*a(n+2)) = -6/25.
Sum_{n >= 1} 6^n/(a(n)*a(n+3)) = 306/1805.
Sum_{n >= 1} 6^n/(a(n)*a(n+4)) = 4282/80275; Sum_{n >= 1} (-6)^n/(a(n)*a(n+4)) = -1698/80275. (End)

Extensions

Edited by Charles R Greathouse IV, Mar 24 2010

A127074 Numbers k such that k^2 divides 3^k - 2^k - 1.

Original entry on oeis.org

1, 2, 3, 4, 7, 49, 179, 619, 17807
Offset: 1

Views

Author

Alexander Adamchuk, Jan 04 2007

Keywords

Comments

No other terms below 10^9.
Prime p divides 3^p - 2^p - 1. Quotients (3^p - 2^p - 1)/p are listed in A127071.
Numbers k such that k divides 3^k - 2^k - 1 are listed in A127072.
The pseudoprimes in A127072 include all powers of primes and some composite numbers that are listed in A127073.
Numbers k such that k^3 divides 3^k - 2^k - 1 begin 1, 4, 7 (with no other terms < 10^8).
Primes in {a(n)} are {2,3,7,179,619,...}.

Crossrefs

Programs

  • Magma
    [n: n in [1..20000] | (3^n-2^n-1) mod n^2 eq 0]; // G. C. Greubel, Jan 30 2020
    
  • Mathematica
    Do[f=(3^n-2^n-1);If[IntegerQ[f/n^2],Print[n]],{n,1,1000}]
    Select[Range[20000], Mod[3^# -2^# -1, #^2]==0 &] (* G. C. Greubel, Jan 30 2020 *)
  • PARI
    for(n=1, 20000, if((3^n-2^n-1)%n^2 == 0, print1(n", "))) \\ G. C. Greubel, Jan 30 2020
    
  • Sage
    [n for n in (1..20000) if mod(3^n-2^n-1, n^2)==0 ] # G. C. Greubel, Jan 30 2020

Extensions

6 incorrect terms deleted by D. S. McNeil, Mar 16 2009 (the old version was 1,2,3,4,7,49,179,619,17807,95041,135433,393217,589825,1376257,1545601)
Edited by Max Alekseyev, Oct 21 2011

A127071 Quotients (3^p - 2^p - 1)/p, where p = prime(n).

Original entry on oeis.org

2, 6, 42, 294, 15918, 122010, 7588770, 61144062, 4092816966, 2366546223930, 19924878993558, 12169831579784970, 889585223857256850, 7633882758103350126, 565719451451489679414, 365721616201373974378410
Offset: 1

Views

Author

Alexander Adamchuk, Jan 04 2007

Keywords

Comments

Prime p divides 3^p - 2^p - 1. 42 = 2*3*7 divides a(n) for n>2.
Numbers n such that n divides 3^n - 2^n - 1 are listed in A127072.
Pseudoprimes in A127072 include all powers of primes {2,3,7} and some composite numbers that are listed in A127073.
Numbers n such that n^2 divides 3^n - 2^n - 1 are listed in A127074.
Numbers n such that n^3 divides 3^n - 2^n - 1 are {1,4,7,...}.

Crossrefs

Programs

  • Magma
    p:=NthPrime; [(3^p(n) -2^p(n) -1)/p(n): n in [1..20]]; // G. C. Greubel, Aug 11 2019
    
  • Maple
    seq((3^ithprime(n) -2^ithprime(n) -1)/(ithprime(n)), n=1..20); # G. C. Greubel, Aug 11 2019
  • Mathematica
    Table[(3^Prime[n]-2^Prime[n]-1)/Prime[n],{n,1,20}]
  • PARI
    vector(20, n, p=prime; (3^p(n) - 2^p(n) -1)/p(n) ) \\ G. C. Greubel, Aug 11 2019
    
  • Sage
    p=nth_prime; [(3^p(n) -2^p(n) -1)/p(n) for n in (1..20)] # G. C. Greubel, Aug 11 2019

Formula

a(n) = (3^prime(n) - 2^prime(n) - 1)/prime(n).

A127072 Numbers k that divide 3^k - 2^k - 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 27, 29, 31, 32, 37, 41, 43, 45, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 127, 128, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233
Offset: 1

Views

Author

Alexander Adamchuk, Jan 04 2007

Keywords

Comments

Prime p divides 3^p - 2^p - 1.
Quotients (3^p - 2^p - 1)/p, where p is prime, are listed in A127071.
Pseudoprimes in a(n) include all powers of primes {2,3,7} and some composite numbers that are listed in A127073.
Numbers k such that k^2 divides 3^k - 2^k - 1 are listed in A127074.
Numbers k such that k^3 divides 3^k - 2^k - 1 are {1, 4, 7, ...}.

Crossrefs

Programs

  • Magma
    [n: n in [1..250] | ((3^n - 2^n - 1) mod n) eq 0]; // G. C. Greubel, Aug 12 2019
    
  • Mathematica
    Select[Range[1000],IntegerQ[(3^#-2^#-1)/# ]&]
  • PARI
    is(n)=Mod(3,n)^n-Mod(2,n)^n==1 \\ Charles R Greathouse IV, Nov 04 2016
    
  • Sage
    [n for n in (1..250) if mod(3^n-2^n-1, n)==0 ] # G. C. Greubel, Jan 30 2020

A130062 Nonprime numbers k such that k divides 3^((k+1)/2) - 2^((k+1)/2) - 1.

Original entry on oeis.org

1, 21, 49, 105, 1729, 2465, 2877, 7305, 10585, 15841, 31021, 31621, 32041, 41041, 46657, 52633, 54145, 75361, 83333, 115921, 126217, 162401, 172081, 211141, 282133, 284649, 294409, 334153, 383161, 399001, 417241, 449065, 488881, 530881
Offset: 1

Views

Author

Alexander Adamchuk, May 05 2007

Keywords

Comments

The perfect squares in listed terms are a(1) = 1, a(3) = 49 = 7^2, a(13) = 32041 = 179^2 and a(29) = 383161 = 619^2.
Note that primes {7,179,619} are the terms of A130060 or primes in A127074.

Crossrefs

Cf. A097934 (primes p that divide 3^((p-1)/2) - 2^((p-1)/2)).
Cf. A038876 (primes p such that 6 is a square mod p).

Programs

  • Mathematica
    Select[ 2*Range[100000]-1, !PrimeQ[ # ] && Mod[ PowerMod[3,(#+1)/2,# ] - PowerMod[2,(#+1)/2,# ] - 1, # ] == 0 & ]

Extensions

More terms from Ryan Propper, Jan 07 2008

A130060 Primes p such that p^2 divides 3^p - 2^p - 1; or primes in A127074(n).

Original entry on oeis.org

2, 3, 7, 179, 619, 17807
Offset: 1

Views

Author

Alexander Adamchuk, May 05 2007

Keywords

Comments

The prime p divides 3^p - 2^p - 1. Quotients (3^p - 2^p - 1)/p, where p = Prime[n], are listed in A127071. - Alexander Adamchuk, Jan 31 2008
a(7) > 10^9. [From D. S. McNeil, Mar 16 2009]

Crossrefs

Cf. A127071, A127072, A127073, A127074 = numbers n such that n^2 divides 3^n - 2^n - 1. Cf. A130058, A130059, A130061, A130062, A130063.

Programs

  • Mathematica
    Do[ n=Prime[k]; f=PowerMod[3,n,n^2] - PowerMod[2,n,n^2] - 1; If[ IntegerQ[ f/n^2 ], Print[n] ], {k,1,100000} ]

Extensions

2 more terms found by Ryan Propper, Jan 01 2008.
Incorrect a(7), a(8) removed by D. S. McNeil, Mar 16 2009. (The old version was 2,3,7,179,619,17807,135433,1376257.)

A130061 Numbers k that divide 3^((k-1)/2) - 2^((k-1)/2) - 1.

Original entry on oeis.org

1, 3, 35, 147, 195, 219, 291, 399, 579, 583, 723, 939, 1011, 1023, 1227, 1299, 1371, 1443, 1731, 1803, 2019, 2307, 2499, 2811, 3003, 3027, 3099, 3387, 3459, 3603, 3747, 3891, 3963, 4467, 4623, 4827, 4971, 5187, 5259, 5331, 5403, 5619, 5979, 6051, 6267
Offset: 1

Views

Author

Alexander Adamchuk, May 05 2007

Keywords

Comments

It appears that all terms are composite except a(1) = 1 and a(2) = 3. Most listed terms are divisible by 3, except {1, 35, 583, 70643, ...}.

Crossrefs

Cf. A097934 (primes p that divide 3^((p-1)/2) - 2^((p-1)/2)).
Cf. A038876 (primes p such that 6 is a square mod p).

Programs

  • Mathematica
    Select[ Range[10000], Mod[ PowerMod[3,(#-1)/2,# ] - PowerMod[2,(#-1)/2,# ] -1, # ]==0&]

A130063 Primes p such that p divides 3^((p+1)/2) - 2^((p+1)/2) - 1.

Original entry on oeis.org

23, 47, 71, 73, 97, 167, 191, 193, 239, 241, 263, 311, 313, 337, 359, 383, 409, 431, 433, 457, 479, 503, 577, 599, 601, 647, 673, 719, 743, 769, 839, 863, 887, 911, 937, 983, 1009, 1031, 1033, 1103, 1129, 1151, 1153, 1201, 1223, 1249, 1297, 1319, 1321, 1367
Offset: 1

Views

Author

Alexander Adamchuk, May 05 2007

Keywords

Comments

Primes = 1 or 23 mod 24. Hence, together with 2, primes such that (2/p) = 1 = (3/p) where (k/p) is the Legendre symbol. - Charles R Greathouse IV, Apr 06 2012

Crossrefs

Cf. A097934 = Primes p such that p divides 3^((p-1)/2) - 2^((p-1)/2).
Subsequence of A038876.

Programs

  • Mathematica
    Select[ Range[2000], PrimeQ[ # ]&&Mod[ PowerMod[3,(#+1)/2,# ] - PowerMod[2,(#+1)/2,# ] - 1, # ]==0&]
    Select[Prime[Range[250]],Divisible[3^((#+1)/2)-2^((#+1)/2)-1,#]&] (* Harvey P. Dale, Mar 21 2021 *)
  • PARI
    is(n)=(n+1)%24<3 && isprime(n) \\ Charles R Greathouse IV, Apr 06 2012
Showing 1-8 of 8 results.