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 61-70 of 102 results. Next

A377573 Cogrowth sequence for the 14-element dihedral group D7 = .

Original entry on oeis.org

1, 0, 1, 0, 3, 0, 10, 1, 35, 9, 126, 55, 462, 286, 1717, 1365, 6451, 6188, 24463, 27132, 93518, 116281, 360031, 490337, 1394582, 2043275, 5430530, 8439210, 21242341, 34621041, 83411715, 141290436, 328589491, 574274008, 1297937234, 2326683921, 5138431851
Offset: 0

Views

Author

Sean A. Irvine, Nov 01 2024

Keywords

Comments

Taking the overlay of the two generating functions in the bisections A072844 and A072266, shows that a(n) = A094052(n-1), n>0. - R. J. Mathar, Nov 05 2024

Examples

			a(4) = 3 corresponds to the TTTT = TSTS = STST = 1. Note: TSTS = (TSTS)(TT) = T(STST)T = TT = 1.
a(9) = 9 corresponds to the words SSSSSSSTT = SSSSSSTTS = SSSSSTTSS = SSSSTTSSS = SSSTTSSSS = SSTTSSSSS = STTSSSSSS = TTSSSSSSS = TSSSSSSST = 1.
		

Crossrefs

Bisections: A072266, A072844.
Cf. A052964 (D5), A007583 (D6), A007582 (D8).

Formula

G.f.: F_7(x) where F_n(x) = 1/2 + (1/(2*n)) * Sum_{j=0..n-1} 1 / (1 - 2*cos(2*Pi*j/n)*x).

A377656 Cogrowth sequence of the 12-element dicyclic group Dic12 = .

Original entry on oeis.org

1, 0, 0, 0, 1, 5, 7, 7, 19, 39, 95, 187, 323, 663, 1351, 2755, 5579, 10863, 21679, 43643, 87411, 175399, 349591, 697843, 1397787, 2796255, 5595135, 11187435, 22362691, 44735255, 89480167, 178966627, 357936619, 715798479, 1431613775, 2863328347, 5726658323
Offset: 0

Views

Author

Sean A. Irvine, Nov 03 2024

Keywords

Examples

			a(5) = 5 corresponds to the words SSSTT = TSSST = TTSSS = STTSS = SSTTS = 1.
		

Crossrefs

Cf. A007583 (D6), A377626 (A4), A377627 (C6 x C2).

A092467 a(n) = Sum_{i+j+k=n, 0<=i,j,k<=n} (n+2k)!/(i! * j! * (3*k)!).

Original entry on oeis.org

1, 3, 13, 63, 309, 1511, 7373, 35951, 175269, 854455, 4165565, 20307647, 99002389, 482649479, 2352978861, 11471077391, 55922991237, 272631840855, 1329115610269, 6479611111519, 31588945184245, 154000207833639
Offset: 0

Views

Author

Benoit Cloitre, Mar 25 2004

Keywords

Comments

In general, Sum_{k=0..n} C(n+2k,3k)*r^k has g.f. (1-r*x)^2/(1-(3r+1)*x+3r^2*x^2-r^3*x^3). - Paul Barry, Aug 23 2007

Crossrefs

Cf. A007583.

Formula

G.f.: (1-4x+4x^2)/(1-7x+12x^2-8x^3). - Ralf Stephan, Dec 02 2004
a(n) = Sum_{k=0..n} C(n+2k,3k)*2^(n-k). - Paul Barry, Aug 23 2007

A175942 Odd numbers k such that 4^k == 4 (mod 3*k) and 2^(k-1) == 4 (mod 3*(k-1)).

Original entry on oeis.org

5, 11, 23, 47, 59, 83, 107, 167, 179, 227, 263, 347, 359, 383, 467, 479, 503, 563, 587, 683, 719, 839, 863, 887, 983, 1019, 1187, 1283, 1307, 1319, 1367, 1439, 1487, 1523, 1619, 1823, 1907, 2027, 2039, 2063, 2099, 2207, 2447, 2459, 2543, 2579, 2819, 2879
Offset: 1

Views

Author

Alzhekeyev Ascar M, Oct 27 2010

Keywords

Comments

Equivalently, integers k == 5 (mod 6) such that 4^k == 4 (mod k) and 2^(k-1) == 4 (mod k-1).
Equivalently, integers k == 5 (mod 6) such that both k and (k-1)/2 are primes or (odd or even) Fermat 4-pseudoprimes (A122781).
Contains terms k of A175625 such that k == 5 (mod 6).
Contains terms k of A303448 such that k == 5 (mod 6).
Many composite terms of this sequence are of the form A007583(m) = (2^(2m+1) + 1)/3 (for m in A303009). It is unknown if there exist composite terms not of this form.
Numbers k such that 2^(k-1) == 3k+1 (mod 3(k-1)k). This sequence contains all safe primes except 7. The term a(20) = 683 = 2*341+1 is the smallest prime that is not safe. - Thomas Ordowski, Jun 07 2021

Crossrefs

Cf. A005385.

Programs

  • Mathematica
    Select[Range[1,3001,2],PowerMod[4,#,3#]==4&&PowerMod[2,#-1,3(#-1)]==4&] (* Harvey P. Dale, Aug 04 2018 *)

Extensions

Edited by Max Alekseyev, Apr 24 2018

A194810 Indices k such that A139250(k) = A000979(n).

Original entry on oeis.org

2, 4, 8, 32, 64, 256, 512, 2048, 32768, 2097152, 1073741824, 549755813888, 1125899906842624, 9223372036854775808, 9671406556917033397649408, 39614081257132168796771975168, 633825300114114700748351602688
Offset: 1

Views

Author

Omar E. Pol, Oct 23 2011

Keywords

Comments

Indices k such that the number of toothpicks in the toothpick structure of A139250 after k-th stage equals the n-th Wagstaff prime A000979. All terms of this sequence are powers of 2 (see formulas).
For a picture of the n-th Wagstaff prime as a toothpick structure see the Applegate link "A139250: the movie version", then enter N = a(n) and click "Update", for N = a(n) <= 32768 (due to the resolution of the movie).

Examples

			For n = 5 we have that a(5) = 64, then we can see that the number of toothpicks in the toothpick structure of A139250 after 64 stages is 2731 which coincides with the fifth Wagstaff prime, so we can write A139250(64) = A000979(5) = 2731. See the illustration in the Applegate-Pol-Sloane paper, figure 3: T(64) = 2731 toothpicks.
		

Crossrefs

Programs

  • Mathematica
    2^Reap[Do[If[PrimeQ[1+Sum[2^(2n-1), {n, m}]], Sow[m]], {m, 100}]][[2, 1]] (* Jean-François Alcover, Oct 06 2018 *)

Formula

a(n) = 2^A127936(n) = 2^(floor(A000978(n)/2)) = 2^(ceiling(log_4(A000979(n)))).
A139250(2^n) = A007583(n), n >= 0.
A139250(a(n)) = A000979(n).

Extensions

More terms from Omar E. Pol, Mar 14 2012

A202672 Array: row n shows the coefficients of the characteristic polynomial of the n-th principal submatrix of the symmetric matrix A087062 based on (1,1,1,1,...); by antidiagonals.

Original entry on oeis.org

1, -1, 1, -3, 1, 1, -5, 6, -1, 1, -7, 15, -10, 1, 1, -9, 28, -35, 15, -1, 1, -11, 45, -84, 70, -21, 1, 1, -13, 66, -165, 210, -126, 28, -1, 1, -15, 91, -286, 495, -462, 210, -36, 1, 1, -17, 120, -455, 1001, -1287, 924, -330, 45, -1, 1, -19, 153
Offset: 1

Views

Author

Clark Kimberling, Dec 22 2011

Keywords

Comments

Let p(n)=p(n,x) be the characteristic polynomial of the n-th principal submatrix of A087062. The zeros of p(n) are positive, and they interlace the zeros of p(n+1).
Closely related to A076756; however, for example, successive rows of A076756 are (1,-3,1), (-1,5,-6,1), compared to rows (1,-3,1), (1,-5,6,-1) of A202672.

Examples

			The 1st principal submatrix (ps) of A087062 is {{1}} (using Mathematica matrix notation), with p(1)=1-x and zero-set {1}.
...
The 2nd ps is {{1,1},{1,2}}, with p(2)=1-3x+x^2 and zero-set {0.381..., 2.618...}.
...
The 3rd ps is {{1,1,1},{1,2,2},{1,2,3}}, with p(3)=1-5x+6x^2-x^3 and zero-set {0.283..., 0.426..., 8.290...}.
...
Top of the array:
1...-1
1...-3....1
1...-5....6....-1
1...-7...15...-10....1
1...-9...28...-35...15...-1
		

Crossrefs

Cf. A087062, A202673 (based on n), A202671 (based on n^2), A202605 (based on Fibonacci numbers), A076756.

Programs

  • Mathematica
    U[n_] := NestList[Most[Prepend[#, 0]] &, #, Length[#] - 1] &[Table[1, {k, 1, n}]];
    L[n_] := Transpose[U[n]];
    F[n_] := CharacteristicPolynomial[L[n].U[n], x];
    c[n_] := CoefficientList[F[n], x]
    TableForm[Flatten[Table[F[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]
    TableForm[Table[c[n], {n, 1, 10}]]
    Table[(F[k] /. x -> -2), {k, 1, 30}] (* A007583 *)
    Table[(F[k] /. x -> 2), {k, 1, 30}]  (* A087168 *)

A206373 a(n) = (14*4^n + 1)/3.

Original entry on oeis.org

5, 19, 75, 299, 1195, 4779, 19115, 76459, 305835, 1223339, 4893355, 19573419, 78293675, 313174699, 1252698795, 5010795179, 20043180715, 80172722859, 320690891435, 1282763565739, 5131054262955, 20524217051819, 82096868207275, 328387472829099, 1313549891316395
Offset: 0

Views

Author

Brad Clardy, Feb 07 2012

Keywords

Comments

A generalized Engel expansion of 2/7 to the base b := 4/3 as defined in A181565 with associated series expansion 2/7 = b/5 + b^2/(5*19) + b^3/(5*19*75) + b^4/(5*19*75*299) + .... - Peter Bala, Oct 30 2013

Crossrefs

Sequences of the form (m*4^n + 1)/3: A007583 (m=2), A136412 (m=5), A199210 (m=11), A199210 (m=11), this sequence (m=14).
Cf. A181565.

Programs

  • Magma
    [(14*4^n+1)/3 : n in [0..30]];
    
  • Mathematica
    (14*4^Range[0,30]+1)/3 (* or *) LinearRecurrence[{5,-4},{5,19},30] (* Harvey P. Dale, Jan 13 2023 *)
  • PARI
    a(n)=(14*4^n + 1)/3 \\ Charles R Greathouse IV, Jun 01 2015
    
  • SageMath
    [(7*2^(2*n+1)+1)/3 for n in range(31)] # G. C. Greubel, Jan 19 2023

Formula

a(n) = (14*4^n + 1)/3.
From Peter Bala, Oct 30 2013: (Start)
a(n+1) = 4*a(n) - 1 with a(0) = 5.
a(n) = 5*a(n-1) - 4*a(n-2) with a(0) = 5 and a(1) = 19.
O.g.f. (5 - 6*x)/((1 - x)*(1 - 4*x)). (End)
E.g.f.: (1/3)*(14*exp(4*x) + exp(x)). - G. C. Greubel, Jan 19 2023

A212591 a(n) is the smallest value of k for which A020986(k) = n.

Original entry on oeis.org

0, 1, 2, 5, 8, 9, 10, 21, 32, 33, 34, 37, 40, 41, 42, 85, 128, 129, 130, 133, 136, 137, 138, 149, 160, 161, 162, 165, 168, 169, 170, 341, 512, 513, 514, 517, 520, 521, 522, 533, 544, 545, 546, 549, 552, 553, 554, 597, 640, 641, 642, 645, 648, 649, 650, 661
Offset: 1

Views

Author

Michael Day, May 22 2012

Keywords

Comments

Brillhart and Morton derive an omega function for the largest values of k. This sequence appears to be given by a similar alpha function.

Crossrefs

Programs

  • J
    NB. J function on a vector
    NB. Beware round-off errors on large arguments
    NB. ok up to ~ 1e8
    alphav =: 3 : 0
    n   =. <: y
    if.+/ ntlo=. n > 0 do.
    n   =. ntlo#n
    m   =. >.-: n
    r   =. <.2^.m
    f   =. <.3%~2+2^2*>:i.>./>:r
    z   =. 0
    mi  =. m
    for_i. i.#f do.
      z   =. z + (i{f) * <.0.5 + mi =. mi%2
    end.
    nzer=. (+/ @: (0=>./\)@:|.)"1 @: #: m
    ntlo #^:_1 z - (2|n) * <.-:nzer{f
    else.
    ntlo
    end.
    )
    NB. eg    alphav 1 3 5 100 2 8 33
  • PARI
    alpha(n)={
    if(n<2, return(max(0,n-1)));
    local(nm1=n-1,
          mi=m=ceil(nm1/2),
          r=floor(log(m)/log(2)),
    i,fi,alpha=0,a);
    forstep(i=1, 2*r+1, 2,
        mi/=2;
        fi=(1+2^i)\3;
    alpha+=fi*floor(0.5+mi);
           );
    alpha*=2;
    if(nm1%2,   \\ adjust for even n
       a=factor(2*m)[1,2]-1;
    alpha-= (1+2^(1+2*a))\3;
      );
    return(alpha);
    }
    

Formula

a(2*n-1) - a(2*n-2) = (2^(2*k+1)+1)/3 and a(2*n) - a(2*n-1) = (2^(2*k+1)+1)/3 with a(0) = a(1) = 0, where n = (2^k)*(2*m-1) for some integers k >= 0 and m > 0.
Restating the formula above, a(n+1) - a(n) = A007583(A050605(n-1)) = A276391 with terms repeated. - John Keith, Mar 04 2021

Extensions

Minor edits by N. J. A. Sloane, Jun 06 2012

A276391 G.f. satisfies A(x) - 4*A(x^2) = x/(1+x).

Original entry on oeis.org

1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 1, 171, 1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 1, 683, 1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 1, 171, 1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 1, 2731, 1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 1, 171, 1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 1, 683, 1, 3, 1, 11, 1, 3
Offset: 1

Views

Author

Bill Gosper, Sep 07 2016

Keywords

Comments

Describes one of the two patterns of spacings of preimages of quadruple points of the Hilbert curve, H(t), 0 <= t <= 1. If H fills the complex unit square [0,1] X [0,i], H(0)=0, H(1)=1, then 1/2 + i/4 is a quadruple point with preimages t in {5/48, 7/48, 41/48, 43/48}. If we can characterize the rest of the quadruple points along the vertical bisector 1/2 + iy, all the rest are generated recursively by the to-quadrant maps (H/i + i)/2, (H + i)/2, (H + i + 1)/2, and (i H + 2)/2. Julian Ziegler Hunts has privately observed that H = 1/2 + ir is a quadruple point for all dyadic rational r in (0,1/2). E.g., the 31 r with denominator 64, i.e., 1/64, 3/64, ..., 31/64 generate preimage 4-tuples
{{1025, 1027, 11261, 11263}, {1037, 1039, 11249, 11251},
{1073, 1075, 11213, 11215}, {1085, 1087, 11201, 11203},
{1217, 1219, 11069, 11071}, {1229, 1231, 11057, 11059},
{1265, 1267, 11021, 11023}, {1277, 1279, 11009, 11011},
{1793, 1795, 10493, 10495}, {1805, 1807, 10481, 10483},
{1841, 1843, 10445, 10447}, {1853, 1855, 10433, 10435},
{1985, 1987, 10301, 10303}, {1997, 1999, 10289, 10291},
{2033, 2035, 10253, 10255}, {2045, 2047, 10241, 10243}}/12288
with differences
{{1, 1, -1, -1}, {3, 3, -3, -3}, {1, 1, -1, -1}, {11, 11, -11, -11},
{1, 1, -1, -1}, {3, 3, -3, -3}, {1, 1, -1, -1}, {43, 43, -43, -43},
{1, 1, -1, -1}, {3, 3, -3, -3}, {1, 1, -1, -1}, {11, 11, -11, -11},
{1, 1, -1, -1}, {3, 3, -3, -3}, {1, 1, -1, -1}}/1024
But the r in (1/2,1) are 1/6th as dense. The relevant quadruple points with denominator 2^n are 1/2 + i (6k - mod(5^n, 12))/2^n, 1 <= k < 2^n/6. E.g., if n = 6, then r is in {37/64, 43/64, 49/64, 55/64, 61/64} and the preimage 4-tuples of 1/2 + ir have differences {{-11, -11, 11, 11}, {-1, -1, 1, 1}, {-3, -3, 3, 3}, {-1, -1, 1, 1}}5/1024 (the reverse of) probably just -5*(this sequence).

Examples

			A(4) = 11. Thus
Table[unbert[1/2 + (2*4+1) I/2^n] - unbert[1/2 + (2*4-1) I/2^n], {n, 5, 9}]
{{11/256, 11/256, -11/256, -11/256},
{11/1024, 11/1024, -11/1024, -11/1024},
{11/4096, 11/4096, -11/4096, -11/4096},
{11/16384, 11/16384, -11/16384, -11/16384},
{11/65536, 11/65536, -11/65536, -11/65536}}
where unbert(H(t)) = {t}, the multivalued inverse Hilbert function (with I = sqrt(-1). See the definition of unbert[] in the MATHEMATICA section.
Note that this table must have n > 4, lest (2*4+1)/2^n > 1/2.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0,
          `if`(n::odd, 1, 4*a(n/2)-1))
        end:
    seq(a(n), n=1..100); # Alois P. Heinz, Sep 07 2016
  • Mathematica
    (* Cf. the numerators of Out[339], below*)
    hilbert[t_] :=
    piecewiserecursivefractal[t, Identity, {Min[4, 1 + Floor[4*#]]} &,
        {1 - 4*# &, 4*# - 1 &, 4*# - 2 &, 4 - 4*# &},
        {I*(1 - #)/2 &, (I + #)/2 &, (I + 1 + #)/2 &, 1 + #*I/2 &}]
    (* E.g., hilbert[1/2] {1/2 + I/2} *)
    unbert[z_] :=
    piecewiserecursivefractal[z, Identity,
         If[0 <= Re[#] <= 1 && 0 <= Im[#] <= 1,
       Range[4], {}] &,
        {1 - 2*#/I &, 2*# - I &, 2*# - I - 1 &, (# - 1)*2/I &},
        {(1 - #)/4 &, (# + 1)/4 &, (# + 2)/4 &, 1 - #/4 &}]
    (* unbert[1/2 + I/2] {1/6, 1/2, 5/6} a triple point: hilbert/@% {{1/2 + I/2}, {1/2 + I/2}, {1/2 + I/2}} *)
    ClearAll[piecewiserecursivefractal];
    piecewiserecursivefractal[x_, f_, which_, iters_, fns_] :=
    CheckAbort[
      Check[piecewiserecursivefractal[x, g_, which, iters,
         fns] = ((piecewiserecursivefractal[x, h_, which, iters, fns] :=
           Block[{y}, y /. Solve[f[y] == h[y], y]]);
         Union @@ ((fns[[#]] /@
               piecewiserecursivefractal[iters[[#]][x],
                Composition[f, fns[[#]]], which, iters, fns]) & /@
            which[x])),
       Abort[], {$RecursionLimit::reclim, $RecursionLimit::reclim2}],
      piecewiserecursivefractal[x, g_, which, iters, fns] =.; Abort[]]
    (* For a simpler but less bulletproof version, see the MATHEMATICA section of A260482 *)
    In[338]:= unbert /@ (1/2 + I Range[1/32, 15/32, 1/16])
    Out[338]= {{257/3072, 259/3072, 2813/3072, 2815/3072},
                 {269/3072, 271/3072, 2801/3072, 2803/3072},
                 {305/3072, 307/3072, 2765/3072, 2767/3072},
                 {317/3072, 319/3072, 2753/3072, 2755/3072},
                 {449/3072, 451/3072, 2621/3072, 2623/3072},
                 {461/3072, 463/3072, 2609/3072, 2611/3072},
                 {497/3072, 499/3072, 2573/3072, 2575/3072},
                 {509/3072, 511/3072, 2561/3072, 2563/3072}}
    In[339]:= Differences@%
    Out[339]= {{1/256, 1/256, -1/256, -1/256},
                 {3/256, 3/256, -3/256, -3/256},
                 {1/256, 1/256, -1/256, -1/256},
                 {11/256, 11/256, -11/256, -11/256},
                 {1/256, 1/256, -1/256, -1/256},
                 {3/256, 3/256, -3/256, -3/256},
                 {1/256, 1/256, -1/256, -1/256}}
    (* Check that %338[[1]] is a quadruple point *)
    In[340]:= hilbert /@ %%[[1]]
    Out[340]= {{1/2 + I/32}, {1/2 + I/32}, {1/2 + I/32}, {1/2 + I/32}}
    In[341]:= Select[Range[0, 1, 1/512], Length[unbert[# + I/2] > 3] &]
    Out[341]= {}
    (* I.e., there aren't any quadruple points on the horizontal bisector of the unit square! Other such horizontal and vertical lines of dyadic rationals intersect a dense set of quadruple points. *)
    a[n_] := (2^(2*IntegerExponent[n, 2]+1) + 1)/3; Array[a, 100] (* Amiram Eldar, Dec 18 2023 *)
  • PARI
    a(n)= fromdigits(binary(n), 4)-fromdigits(binary(n-1), 4) \\ Bill McEachen, Dec 20 2024

Formula

a(n) = (2 + 4^A001511(n))/6.
G.f.: A(x) - 4*A(x^2) = x/(1+x).
From Alois P. Heinz, Sep 07 2016: (Start)
a(2^n) = A007583(n).
a(2^n+n) = a(n) + A000007(n).
(a(2*n)+1)/4 = a(n) for n>0. (End)
a(n) = A000695(n) - A000695(n-1). - Bill McEachen, Oct 30 2020
G.f.: Sum_{k>=0} 4^k * x^(2^k) / (1 + x^(2^k)). - Ilya Gutkovskiy, Dec 14 2020

Extensions

Keyword:mult added by Andrew Howroyd, Aug 06 2018

A307485 A permutation of the nonnegative integers: one odd, two even, four odd, eight even, etc.; extended to nonnegative integer with a(0) = 0.

Original entry on oeis.org

0, 1, 2, 4, 3, 5, 7, 9, 6, 8, 10, 12, 14, 16, 18, 20, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 43, 45, 47, 49, 51, 53, 55
Offset: 0

Views

Author

M. F. Hasler, Apr 18 2019

Keywords

Comments

The simple idea of "list the first odd number, first two even numbers, next four odd numbers, next eight even numbers..." leads to a permutation of the positive integers, which can quite naturally be extended to a permutation of the nonnegative integers, with a(0) = 0.

Examples

			The first odd number is a(1) = 1,
the first two even numbers are a(2..3) = (2, 4),
the next four odd numbers are a(4..7) = (3, 5, 7, 9),
the next eight even numbers are a(8..15) = (6, 8, ..., 20), etc.
the next sixteen odd numbers are a(16..31) = (11, 13, ..., 41),
the next thirty-two even numbers are a(32..63) = (22, 24, ..., 84), etc.
the next 64 odd numbers are a(64..127) = (43, 45, ..., 169),
the next 128 even numbers are a(128..255) = (86, 88, ..., 340), etc.
		

Crossrefs

Cf. A196521, A307613 (inverse permutation), A307612 (partial sums).
Cf. A103889 (odd & even swapped), A004442 (pairs reversed: n + (-1)^n).
Odd numbers: A005408. Even numbers: A005843.
Cf. A233275 (different permutation based on entangling odd & even numbers).

Programs

  • Mathematica
    Join[{0},Flatten[Riffle[TakeList[Range[1,169,2],2^Range[0,6,2]],TakeList[Range[ 2,340,2],2^Range[ 1,7,2]]]]] (* Harvey P. Dale, Dec 17 2022 *)
  • PARI
    A307485(n)=2*n-2^logint(n<<2+1,2)\3

Formula

Ignoring a(0) = 0, the k-th block (k >= 1) has 2^(k-1) terms, indexed from 2^(k-1) through 2^k-1, all having the same parity as k.
The difference between the last and the first term of this range is: a(2^k-1) - a(2^(k-1)) = 2^k - 2 = (2^(k-1) - 1)*2 = (starting index - 1) times two = ending index minus one.
The 1st, 3rd, ..., (2n+1)-th block = (n+1)-th odd block starts with A007583(n) = (1, 3, 11, 43, 171, ...), n >= 0.
The 2nd, 4th, ..., (2n+2)-th block = (n+1)-th even block starts with 2*A007583(n) = (2, 6, 22, 86, 342, ...), n >= 0, i.e., twice the starting value of the preceding odd block.
a(n) = 2*n - floor(2^k/3) where k = floor(log_2(4n+1)), n >= 0. (And 2^k == (-1)^k (mod 3) => floor(2^k/3) = (2^k-m)/3 with m = 1 if k even, m = 2 if k odd.)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 - log(2)/2 (A196521). - Amiram Eldar, Nov 28 2023
Previous Showing 61-70 of 102 results. Next