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.

Previous Showing 11-20 of 129 results. Next

A083420 a(n) = 2*4^n - 1.

Original entry on oeis.org

1, 7, 31, 127, 511, 2047, 8191, 32767, 131071, 524287, 2097151, 8388607, 33554431, 134217727, 536870911, 2147483647, 8589934591, 34359738367, 137438953471, 549755813887, 2199023255551, 8796093022207, 35184372088831, 140737488355327, 562949953421311
Offset: 0

Views

Author

Paul Barry, Apr 29 2003

Keywords

Comments

Sum of divisors of 4^n. - Paul Barry, Oct 13 2005
Subsequence of A000069; A132680(a(n)) = A005408(n). - Reinhard Zumkeller, Aug 26 2007
If x = a(n), y = A000079(n+1) and z = A087289(n), then x^2 + 2*y^2 = z^2. - Vincenzo Librandi, Jun 09 2014
It seems that a(n) divides A001676(3+4n). Several other entries apparently have this sequence embedded in them, e.g., A014551, A168604, A213243, A213246-8, and A279872. - Tom Copeland, Dec 27 2016
To elaborate on Librandi's comment from 2014: all these numbers, even if prime in Z, are sure not to be prime in Z[sqrt(2)], since a(n) can at least be factored as ((2^(2n + 1) - 1) - (2^(2n) - 1)*sqrt(2))((2^(2n + 1) - 1) + (2^(2n) - 1)*sqrt(2)). For example, 7 = (3 - sqrt(2))(3 + sqrt(2)), 31 = (7 - 3*sqrt(2))(7 + 3*sqrt(2)), 127 = (15 - 7*sqrt(2))(15 + 7*sqrt(2)). - Alonso del Arte, Oct 17 2017
Largest odd factors of A147590. - César Aguilera, Jan 07 2020

Crossrefs

Cf. A083421, A000668 (primes in this sequence), A004171, A000244.
Cf. A000302.

Programs

Formula

G.f.: (1+2*x)/((1-x)*(1-4*x)).
E.g.f.: 2*exp(4*x)-exp(x).
With a leading zero, this is a(n) = (4^n - 2 + 0^n)/2, the binomial transform of A080925. - Paul Barry, May 19 2003
From Benoit Cloitre, Jun 18 2004: (Start)
a(n) = (-16^n/2)*B(2n, 1/4)/B(2n) where B(n, x) is the n-th Bernoulli polynomial and B(k) = B(k, 0) is the k-th Bernoulli number.
a(n) = 5*a(n-1) - 4*a(n-2).
a(n) = (-4^n/2)*B(2*n, 1/2)/B(2*n). (End)
a(n) = A099393(n) + A020522(n) = A000302(n) + A024036(n). - Reinhard Zumkeller, Feb 07 2006
a(n) = Stirling2(2*(n+1), 2). - Zerinvary Lajos, Dec 06 2006
a(n) = 4*a(n-1) + 3 with n > 0, a(0) = 1. - Vincenzo Librandi, Dec 30 2010
a(n) = A001576(n+1) - 2*A001576(n). - Brad Clardy, Mar 26 2011
a(n) = 6*A002450(n) + 1. - Roderick MacPhee, Jul 06 2012
a(n) = A000203(A000302(n)). - Michel Marcus, Jan 20 2014
a(n) = Sum_{i = 0..n} binomial(2n+2, 2i). - Wesley Ivan Hurt, Mar 14 2015
a(n) = (1/4^n) * Sum_{k = 0..n} binomial(2*n+1,2*k)*9^k. - Peter Bala, Feb 06 2019
a(n) = A147590(n)/A000079(n). - César Aguilera, Jan 07 2020

A039770 Numbers k such that phi(k) is a perfect square.

Original entry on oeis.org

1, 2, 5, 8, 10, 12, 17, 32, 34, 37, 40, 48, 57, 60, 63, 74, 76, 85, 101, 108, 114, 125, 126, 128, 136, 160, 170, 185, 192, 197, 202, 204, 219, 240, 250, 257, 273, 285, 292, 296, 304, 315, 364, 370, 380, 394, 401, 432, 438, 444, 451, 456, 468, 489, 504, 505
Offset: 1

Views

Author

Keywords

Comments

A004171 is a subsequence because phi(2^(2k+1)) = (2^k)^2. - Enrique Pérez Herrero, Aug 25 2011
Subsequence of primes is A002496 since in this case phi(k^2+1) = k^2. - Bernard Schott, Mar 06 2023
Products of distinct terms of A002496 form a subsequence. - Chai Wah Wu, Aug 22 2025

Examples

			phi(34) = 16 = 4*4.
		

References

  • D. M. Burton, Elementary Number Theory, Allyn and Bacon Inc., Boston MA, 1976, p. 141.

Crossrefs

Cf. A000010, A007614. A062732 gives the squares. A306882 (squares not totient).

Programs

  • Maple
    with(numtheory); isA039770 := proc (n) return issqr(phi(n)) end proc; seq(`if`(isA039770(n), n, NULL), n = 1 .. 505); # Nathaniel Johnston, Oct 09 2013
  • Mathematica
    Select[ Range[ 600 ], IntegerQ[ Sqrt[ EulerPhi[ # ] ] ]& ]
  • PARI
    for(n=1, 120, if (issquare(eulerphi(n)), print1(n, ", ")))
    
  • Python
    from math import isqrt
    from sympy import totient as phi
    def ok(n): return isqrt(p:=phi(n))**2 == p
    print([k for k in range(1, 506) if ok(k)]) # Michael S. Branicky, Aug 17 2025

Formula

a(n) seems to be asymptotic to c*n^(3/2) with 1 < c < 1.3. - Benoit Cloitre, Sep 08 2002
Banks, Friedlander, Pomerance, and Shparlinski show that a(n) = O(n^1.421). - Charles R Greathouse IV, Aug 24 2009

A000980 Number of ways of writing 0 as Sum_{k=-n..n} e(k)*k, where e(k) is 0 or 1.

Original entry on oeis.org

2, 4, 8, 20, 52, 152, 472, 1520, 5044, 17112, 59008, 206260, 729096, 2601640, 9358944, 33904324, 123580884, 452902072, 1667837680, 6168510256, 22903260088, 85338450344, 318995297200, 1195901750512, 4495448217544, 16940411201280, 63983233268592
Offset: 0

Views

Author

Keywords

Comments

The 4-term sequence 2,4,8,20 is the answer to the "Solitaire Army" problem, or checker-jumping puzzle. It is too short to have its own entry. See Conway et a;., Winning Ways, Vol. 2, pp. 715-717. - N. J. A. Sloane, Mar 01 2018
Number of subsets of {-n..n} with sum 0. Also the number of subsets of {0..2n} that are empty or have mean n. For median instead of mean we have twice A024718. - Gus Wiseman, Apr 23 2023

Examples

			From _Gus Wiseman_, Apr 23 2023: (Start)
The a(0) = 2 through a(2) = 8 subsets of {-n..n} with sum 0 are:
  {}   {}        {}
  {0}  {0}       {0}
       {-1,1}    {-1,1}
       {-1,0,1}  {-2,2}
                 {-1,0,1}
                 {-2,0,2}
                 {-2,-1,1,2}
                 {-2,-1,0,1,2}
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 294.
  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see pp. 715-717.
  • 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

A047653(n) = a(n)/2.
Bisection of A084239. Cf. A063865, A141000.
A007318 counts subsets by length, A327481 by integer mean.
A327475 counts subsets with integer mean, A000975 integer median.

Programs

  • Haskell
    a000980 n = length $ filter ((== 0) . sum) $ subsequences [-n..n]
  • Maple
    b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0,
          `if`(i=0, 1, 2*b(n, i-1)+b(n+i, i-1)+b(abs(n-i), i-1)))
        end:
    a:=n-> 2*b(0, n):
    seq(a(n), n=0..40); # Alois P. Heinz, Mar 10 2014
  • Mathematica
    a[n_] := SeriesCoefficient[ Product[1+x^k, {k, -n, n}], {x, 0, 0}]; a[0] = 2; Table[a[n], {n, 0, 24}](* Jean-François Alcover, Nov 28 2011 *)
    nmax = 26; d = {2}; a1 = {};
    Do[
      i = Ceiling[Length[d]/2];
      AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
      d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n] +
        2 PadLeft[PadRight[d, Length[d] + n], Length[d] + 2 n];
      , {n, nmax}];
    a1 (* Ray Chandler, Mar 15 2014 *)
    Table[Length[Select[Subsets[Range[-n,n]],Total[#]==0&]],{n,0,5}] (* Gus Wiseman, Apr 23 2023 *)
  • PARI
    a(n)=polcoeff(prod(k=-n,n,1+x^k),0)
    

Formula

Constant term of Product_{k=-n..n} (1+x^k).
a(n) = Sum_i A067059(2n+1-i, i) = 2+2*Sum_j A047997(n, j); i.e., sum of alternate antidiagonals of A067059 and two more than twice row sums of A047997. - Henry Bottomley, Aug 11 2002
a(n) = A004171(n) - 2*A181765(n).
Coefficient of x^(n*(n+1)/2) in 2*Product_{k=1..n} (1+x^k)^2. - Sean A. Irvine, Oct 03 2011
From Gus Wiseman, Apr 23 2023: (Start)
a(n) = 2*A047653(n).
a(n) = A070925(2n+1) + 1.
a(n) = 2*A133406(2n+1).
a(n) = 2*(A212352(n) + 1).
a(n) = A222955(2n+1).
a(n) = 2*(A362046(2n) + 1).
(End)

Extensions

More terms from Michael Somos, Jun 10 2000

A002063 a(n) = 9*4^n.

Original entry on oeis.org

9, 36, 144, 576, 2304, 9216, 36864, 147456, 589824, 2359296, 9437184, 37748736, 150994944, 603979776, 2415919104, 9663676416, 38654705664, 154618822656, 618475290624, 2473901162496, 9895604649984, 39582418599936, 158329674399744, 633318697598976
Offset: 0

Views

Author

Keywords

Comments

a(n) is twice the area of the trapezoid created by the four points (2^n,2^(n+1)), (2^(n+1), 2^n), (2^(n+1), 2^(n+2)), (2^(n+2), 2^(n+1)). - J. M. Bergot, May 23 2014
These are squares that can be expressed as sum of exactly two distinct powers of two. For instance, a(4) = 9*4^4 = 2304 = 2^11 + 2^8 . It is conjectured that these are the only squares with this characteristic (tested on squares up to (10^7)^2). - Andres Cicuttin, Apr 23 2016
Conjecture is true. It is equivalent to prove that the Diophantine equation m^2 = 2^k*(1+2^h), where h>0, has solutions only when h=3. Dividing by 2^k we must obtain an odd square on the left, since 1+2^h is odd, so we can write (2*r+1)^2 = 1+2^h. Expanding, we have 4*r*(r+1) = 2^h, from which it follows that r must be equal to 1 and thus h=3, since r and r+1 must be powers of 2. - Giovanni Resta, Jul 27 2017

Crossrefs

Essentially the same as A055841. First differences of A002001.
Cf. A000302.

Programs

Formula

From Philippe Deléham, Nov 23 2008: (Start)
a(n) = 4*a(n-1), n > 0; a(0)=9.
G.f.: 9/(1-4*x). (End)
a(n) = 9*A000302(n). - Michel Marcus, Apr 23 2016
E.g.f.: 9*exp(4*x). - Ilya Gutkovskiy, Apr 23 2016
a(n) = 2^(2*n+3) + 2^(2*n). - Andres Cicuttin, Apr 26 2016
a(n) = A004171(n+1) + A000302(n). - Zhandos Mambetaliyev, Nov 19 2016

A087289 a(n) = 2^(2*n+1) + 1.

Original entry on oeis.org

3, 9, 33, 129, 513, 2049, 8193, 32769, 131073, 524289, 2097153, 8388609, 33554433, 134217729, 536870913, 2147483649, 8589934593, 34359738369, 137438953473, 549755813889, 2199023255553, 8796093022209, 35184372088833, 140737488355329, 562949953421313, 2251799813685249
Offset: 0

Views

Author

W. Edwin Clark, Aug 29 2003

Keywords

Comments

Number of pairs of polynomials (f,g) in GF(2)[x] satisfying deg(f) <= n, deg(g) <= n and gcd(f,g) = 1.
An unpublished result due to Stephen Suen, David desJardins, and W. Edwin Clark. This is the case k = 2, q = 2 of their formula q^((n+1)*k) * (1 - 1/q^(k-1) + (q-1)/q^((n+1)*k)) for the number of ordered k-tuples (f_1, ..., f_k) of polynomials in GF(q)[x] such that deg(f_i) <= n for all i and gcd(f_1, ..., f_k) = 1.
Apparently the same as A084508 shifted left.
Terms in binary are palindromes of the form 1x1 where x is a string of 2*n zeros (A152577). - Brad Clardy, Sep 01 2011
For n > 0, a(n) is the number k such that the number of iterations of the map k -> (3k +1)/8 == 4 (mod 8) until reaching (3k +1)/8 <> 4 (mod 8) equals n. (see the Collatz problem: the start of the parity trajectory of a(n) is n times {100} = 100100100100...100abcd...). - Michel Lagneau, Jan 23 2012
An Engel expansion of 2 to the base 4 as defined in A181565, with the associated series expansion 2 = 4/3 + 4^2/(3*9) + 4^3/(3*9*33) + 4^4/(3*9*33*129) + .... Cf. A199561 and A207262. - Peter Bala, Oct 29 2013
For x = A083420(n), y = A000079(n+1), z = a(n) then x^2 + 2*y^2 = z^2. - Vincenzo Librandi, Jun 09 2014
A254046(n+1) is the 3-adic valuation of a(n). - Fred Daniel Kline, Jan 11 2017

Examples

			a(0) = 3 since there are three pairs, (0,1), (1,0) and (1,1) of polynomials (f,g) in GF(2)[x] of degree at most 0 such that gcd(f,g) = 1.
		

Crossrefs

Programs

  • Magma
    [2^(2*n+1) + 1: n in [0..30]]; // Vincenzo Librandi, May 16 2011
    
  • Mathematica
    Table[2^(2 n + 1) + 1, {n, 0, 20}] (* or *) 3 NestList[4 # - 1 &, 1, 20]
    (* or *) CoefficientList[Series[(3 - 6 x)/((1 - x) (1 - 4 x)), {x, 0, 20}], x] (* Michael De Vlieger, Mar 03 2017 *)
  • PARI
    a(n)=2^(2*n+1)+1 \\ Charles R Greathouse IV, Sep 24 2015

Formula

G.f.: (3-6*x)/((1-x)*(1-4*x)).
a(n) = 3*A007583(n).
a(n) = 4*a(n-1) - 3. - Lekraj Beedassy, Apr 29 2005
a(n) = A099393(n+1) - 2*A099393(n). - Brad Clardy, Sep 01 2011
a(n) = 2^(2*n + 1)*a(-1-n) for all n in Z. - Michael Somos, Jan 11 2017
a(n) = A283070(n) - 1. - Peter M. Chema, Mar 02 2017
From Elmo R. Oliveira, Feb 22 2025: (Start)
E.g.f.: exp(x)*(2*exp(3*x) + 1).
a(n) = 5*a(n-1) - 4*a(n-2). (End)

A152978 a(n) = A139251(n+2)/4 = A152968(n+1)/2.

Original entry on oeis.org

1, 1, 1, 2, 3, 2, 1, 2, 3, 3, 4, 7, 8, 4, 1, 2, 3, 3, 4, 7, 8, 5, 4, 7, 9, 10, 15, 22, 20, 8, 1, 2, 3, 3, 4, 7, 8, 5, 4, 7, 9, 10, 15, 22, 20, 9, 4, 7, 9, 10, 15, 22, 21, 14, 15, 23, 28, 35, 52, 64, 48, 16, 1, 2, 3, 3, 4, 7, 8, 5, 4, 7, 9, 10, 15, 22, 20, 9, 4, 7, 9, 10, 15, 22, 21, 14, 15, 23
Offset: 1

Views

Author

Omar E. Pol, Dec 16 2008, Dec 20 2008

Keywords

Comments

Also, first differences of toothpick numbers A153000.

Examples

			If written as a triangle, begins:
.1,1;
.1,2,3,2;
.1,2,3,3,4,7,8,4;
.1,2,3,3,4,7,8,5,4,7,9,10,15,22,20,8;
....
Rows converge to A152980.
It appears that row sums give A004171. [From _Omar E. Pol_, May 25 2010]
		

Crossrefs

Cf. toothpick sequence A139250.
Cf. A004171. [From Omar E. Pol, May 25 2010]

Formula

G.f.: (1+x)*(Prod(1+x^(2^k-1)+2*x^(2^k),k=1..oo)-1)/(1+2*x). - N. J. A. Sloane, May 20 2009

Extensions

More terms from Omar E. Pol, Jul 26 2009

A083233 a(n) = (3*8^n + 0^n)/4.

Original entry on oeis.org

1, 6, 48, 384, 3072, 24576, 196608, 1572864, 12582912, 100663296, 805306368, 6442450944, 51539607552, 412316860416, 3298534883328, 26388279066624, 211106232532992, 1688849860263936, 13510798882111488, 108086391056891904, 864691128455135232
Offset: 0

Views

Author

Paul Barry, Apr 23 2003

Keywords

Comments

Binomial transform of A083232. Inverse binomial transform of A066443.
Numbers k such that, except for some first term, k^2 = [A000302]^3 + [A004171]^3 + [A002001]^3; e.g., 3072^2 = 64^3 + 128^3 + 192^3; 51539607552^2 = 4194304^3 + 8388608^3 + 12582912^3. - Vincenzo Librandi, Aug 08 2010
With the exception of the first term, these numbers cannot be written as the sum of two integer cubes but can be written as the sum of two positive rational cubes (i.e., 6*8^n = (17*2^n/21)^3 + (37*2^n/21)^3). - Arkadiusz Wesolowski, Aug 15 2013
a(n+1) is the number of unit square faces on the convex hull of a level n Menger sponge. This follows since it has six exterior faces, each of which is a Sierpinski carpet with 8^n squares. - Allan Bickle, Nov 28 2022

Examples

			a(0) = (3*8^0 + 0^0)/4 = 4/4 = 1 (using 0^0 = 1).
		

Crossrefs

Cf. A083234. Subsequence of A159843.
Cf. A291066, A083233, and A332705 on the surface area of the n-Menger sponge graph.

Programs

Formula

a(n) = (3*8^n + 0^n)/4.
G.f.: (1-2x)/(1-8x).
E.g.f.: (3*exp(8x) + exp(0))/4.
a(0) = 1, a(n+1) = 6*8^n. - Arkadiusz Wesolowski, Aug 15 2013

A002023 a(n) = 6*4^n.

Original entry on oeis.org

6, 24, 96, 384, 1536, 6144, 24576, 98304, 393216, 1572864, 6291456, 25165824, 100663296, 402653184, 1610612736, 6442450944, 25769803776, 103079215104, 412316860416, 1649267441664, 6597069766656, 26388279066624, 105553116266496, 422212465065984
Offset: 0

Views

Author

Keywords

Comments

From Peter M. Chema, Mar 02 2017: (Start)
Number of rods (line segments) required to make a Sierpinski tetrahedron of side length 2^n.
Also equals the number of balls (vertices) in a Sierpinski tetrahedron of side length 2^n+1 minus the number of balls in a Sierpinski tetrahedron of side length 2^n (the first difference in the tetrix numbers). See formula. (End)
Equivalently, the number of edges in the (n+1)-Sierpinski tetrahedron graph. - Eric W. Weisstein, Aug 17 2017
These numbers a(n) together with the 13 numbers from A337217 give the positive integers m represented uniquely by the ternary form x^2 + y^2 + 2*z^2, with integers 0 <= x <= y and 0 <= z. This is theorem 2.1 of Kaplansky, p. 87 with proof on p. 90. - Wolfdieter Lang, Aug 20 2020
a(n) is also the domination number of the (n+3)-Sierpinski tetrahedron graph. - Eric W. Weisstein, Sep 13 2021

References

  • Irving Kaplansky, Integers Uniquely Represented by Certain Ternary Forms, in "The Mathematics of Paul Erdős I", Ronald. L. Graham and Jaroslav Nešetřil (Eds.), Springer, 1997, pp. 86 - 94.

Crossrefs

Cf. A283070 (vertex count).
Cf. A004171.

Programs

Formula

From Philippe Deléham, Nov 23 2008: (Start)
a(n) = 4*a(n-1) for n > 0, a(0)=6.
G.f.: 6/(1-4*x). (End)
a(n) = 3*A004171(n). - R. J. Mathar, Mar 08 2011
From Peter M. Chema, Mar 03 2017: (Start)
a(n) = A283070(n+1) - A283070(n).
a(n) = A004171(n+1) - A004171(n). (End)
E.g.f.: 6*exp(4*x). - G. C. Greubel, Aug 17 2017

A360677 Sum of the right half (exclusive) of the prime indices of n.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 0, 1, 2, 3, 0, 2, 0, 4, 3, 2, 0, 2, 0, 3, 4, 5, 0, 3, 3, 6, 2, 4, 0, 3, 0, 2, 5, 7, 4, 4, 0, 8, 6, 4, 0, 4, 0, 5, 3, 9, 0, 3, 4, 3, 7, 6, 0, 4, 5, 5, 8, 10, 0, 5, 0, 11, 4, 3, 6, 5, 0, 7, 9, 4, 0, 4, 0, 12, 3, 8, 5, 6, 0, 4, 4, 13, 0, 6, 7
Offset: 1

Views

Author

Gus Wiseman, Mar 05 2023

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The prime indices of 810 are {1,2,2,2,2,3}, with right half (exclusive) {2,2,3}, so a(810) = 7.
The prime indices of 3675 are {2,3,3,4,4}, with right half (exclusive) {4,4}, so a(3675) = 8.
		

Crossrefs

Positions of 0's are 1 and A000040.
Positions of last appearances are A004171.
Positions of first appearances are A100484.
These partitions are counted by A360672.
The value k > 0 appears A360673(k) times, inclusive A360671.
The left version is A360676.
The inclusive version is A360679.
A112798 lists prime indices, length A001222, sum A056239, median* A360005.
A360616 gives half of bigomega (exclusive), inclusive A360617.
First for prime indices, second for partitions, third for prime factors:
- A360676 gives left sum (exclusive), counted by A360672, product A361200.
- A360677 gives right sum (exclusive), counted by A360675, product A361201.
- A360678 gives left sum (inclusive), counted by A360675, product A347043.
- A360679 gives right sum (inclusive), counted by A360672, product A347044.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Total[Take[prix[n],-Floor[Length[prix[n]]/2]]],{n,100}]

Formula

Last position of k is 2^(2k+1).
A360676(n) + A360679(n) = A001222(n).
A360677(n) + A360678(n) = A001222(n).

A096773 a(n) = 4*a(n-2) + 1 with a(1) = 0, a(2) = 3.

Original entry on oeis.org

0, 3, 1, 13, 5, 53, 21, 213, 85, 853, 341, 3413, 1365, 13653, 5461, 54613, 21845, 218453, 87381, 873813, 349525, 3495253, 1398101, 13981013, 5592405, 55924053, 22369621, 223696213, 89478485, 894784853, 357913941, 3579139413, 1431655765
Offset: 1

Views

Author

Gottfried Helms, Aug 15 2004

Keywords

Comments

Remainders for classes m of integers n (mod 2^(m+1)). After applying one Collatz (3x+1)-transformation to the so-classified integers the result can be written in two classes (mod 6) only.
This classifying scheme covers all positive integers.
With one 3x+1-transformation T(x;p) := x' = (3x+1)/2^p, all numbers x, described in the form, with the free parameter i >= 0, x = i*2^N + a(N) result in x', describable by the two classes with the same parameter i:
x' = i*6 + 1 (for odd N>2), or x' = i*6 + 5 (for even N). Thus
x = 4*i + 3 -> x' = 6*i + 5, x = 8*i + 1 -> x' = 6*i + 1,
x = 16*i + 13 -> x' = 6*i + 5, x = 32*i + 5 -> x' = 6*i + 1,
x = 64*i + 53 -> x' = 6*i + 5, x = 128*i + 21 -> x' = 6*i + 1,
....
all with "i" as a free parameter >= 0 covering all positive integers.

Examples

			a(1) = (2^0-1)/3 =  0, a(2) = (5*2^1 - 1) / 3 =  3,
a(3) = (2^2-1)/3 =  1, a(4) = (5*2^3 - 1) / 3 = 13,
a(5) = (2^4-1)/3 =  5, a(6) = (5*2^5 - 1) / 3 = 53,
a(7) = (2^6-1)/3 = 21.
....
		

Crossrefs

Bisections are A002450 & A072197.
After the initial 0, column 1 of A257852.
Cf. A176965.

Programs

  • Magma
    [(2^(n-1)*(3 + 2*(-1)^n) - 1)/3: n in [1..40]]; // Vincenzo Librandi, Jul 12 2015
    
  • Mathematica
    a[1] = 0; a[2] = 3; a[n_] := a[n] = 4a[n - 2] + 1; Table[ a[n], {n, 35}] (* Robert G. Wilson v, Aug 20 2004 *)
    Table[(2^(n - 1)*(3 + 2*(-1)^(n)) - 1)/3, {n, 10}] (* L. Edson Jeffery, Jul 12 2015 *)
    nxt[{a_,b_}]:={b,4a+1}; NestList[nxt,{0,3},40][[;;,1]] (* or *) LinearRecurrence[{1,4,-4},{0,3,1},40] (* Harvey P. Dale, Mar 19 2025 *)
  • PARI
    apply( {A096773(n) = if(n%2, 1, 5)<<(n-1)\3}, [1..55]) \\ M. F. Hasler, May 28 2024
    
  • Perl
    # To map any (odd) v to its (r,c):
    use bigint; $v=149; $r=$c=0; while(1){ $b=($v&1); $v>>=1; if ($b==($v&1)){ $c=($v>>1); last} $r++} $r&=1; # this splits the binary representation into two parts, at the first repeated digit from the right: the number of bits on the right is the row value, and the binary value on the left is the column value. Example: 149 => 1.00.10101 => (r,c)=(5,1). Ruud H.G. van Tol, Sep 23 2021
    
  • Python
    A096773=lambda n:((1 if n&1 else 5)<M. F. Hasler, May 28 2024

Formula

a(2m) = (5*2^(2m-1) - 1)/3, a(2m-1) = (2^(2m-2)-1)/3.
From Paul Curtz, Jul 01 2008; corrected by Bob Selcoe, Jul 28 2018: (Start)
a(2n) = 10*a(2n-1) + 3.
a(n+1) - 2*a(n) = A001045(n+2), signed. (End)
a(n) = (2^(n-1)*(3 + 2*(-1)^n) - 1)/3. - L. Edson Jeffery, Jul 12 2015
a(2n) = A086893(2n), a(2n+1) = A086893(2n-1), n > 0. - Yosu Yurramendi, Jan 17 2017
G.f.: -x^2*(-3+2*x) / ( (x-1)*(2*x+1)*(2*x-1) ). - R. J. Mathar, Mar 07 2017
a(2n) = A072197(n-1), n > 0; a(2n+1) = A002450(n), n >= 0. - Yosu Yurramendi, Mar 07 2017
a(2n) = (A266753(n) + A004171(n-1))/2, a(2n+1) = (A266753(n) - A004171(n-1))/2, n > 0. - Yosu Yurramendi, Mar 07 2017
a(n) = least residue 2*3^(2^(n-4)-1) - 1 (mod 2^n), n >= 5. - Bob Selcoe, Jul 26 2018
a(n) = 2*A176965(n-1) + 1 for n > 1. - Loren M. Pearson, Dec 06 2024
Previous Showing 11-20 of 129 results. Next