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 41-50 of 102 results. Next

A073724 a(n) = (4^(n+1) + 6n + 5)/9.

Original entry on oeis.org

1, 3, 9, 31, 117, 459, 1825, 7287, 29133, 116515, 466041, 1864143, 7456549, 29826171, 119304657, 477218599, 1908874365, 7635497427, 30541989673, 122167958655, 488671834581, 1954687338283, 7818749353089, 31274997412311
Offset: 0

Views

Author

Wouter Meeussen, Sep 01 2002

Keywords

Comments

a(n) is the number of times a disk is moved from peg 1 to peg 2 during a move of a tower of 2n or (2n-1) disks from peg 1 to peg 2 ("Tower of Hanoi" problem). Binomial transform of A025579.
An approximation to A091841.

Examples

			Moving a tower of 4 disks = 2^4 - 1 moves, coded {1,0,5,1,2,3,1,0,5,4,2,5,1,0,5}. The move from peg 1 to peg 2 has code "0" and this occurs 3 times. For 3 disks we also find 3 zeros in {0,1,3,0,4,5,0}. Hence a(2)=3. The coding corresponds to the rank of the permutation {'from peg' 1, 'to peg' 2, 'by peg' 3} or {1,2,3} with rank 0.
		

Crossrefs

Cf. A001045, A002450, A007583, A020988, A025579, A047849 (first differences), A090822, A091841.

Programs

  • Magma
    [(4^(n+1)+6*n+5)/9: n in [0..40] ]; // Vincenzo Librandi, Apr 28 2011
  • Mathematica
    Table[(4^(n+1)+6n+5)/9, {n, 0, 24}]
  • PARI
    a(n)=(4*4^n+6*n+5)/9
    
  • PARI
    a(n)=polcoeff((1-3*x)/(1-4*x)/(1-x)^2+x*O(x^n),n)
    

Formula

G.f.: (1-3*x)/((1-4*x)*(1-x)^2).
a(n) = Sum_{k=0..n} A047849(k). - L. Edson Jeffery, May 01 2021
From Elmo R. Oliveira, Dec 11 2023: (Start)
a(n) = 6*a(n-1) - 9*a(n-2) + 4*a(n-3) for n>2.
E.g.f.: (1/9)*(4*(exp(4*x)) + 6*x*exp(x) + 5*exp(x)). (End)

A191669 Dispersion of A004767 (4k+3, k>=0), by antidiagonals.

Original entry on oeis.org

1, 3, 2, 11, 7, 4, 43, 27, 15, 5, 171, 107, 59, 19, 6, 683, 427, 235, 75, 23, 8, 2731, 1707, 939, 299, 91, 31, 9, 10923, 6827, 3755, 1195, 363, 123, 35, 10, 43691, 27307, 15019, 4779, 1451, 491, 139, 39, 12, 174763, 109227, 60075, 19115, 5803, 1963, 555, 155
Offset: 1

Views

Author

Clark Kimberling, Jun 11 2011

Keywords

Comments

For a background discussion of dispersions, see A191426.
...
Each of the sequences (4n, n>2), (4n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
A191452=dispersion of A008586 (4k, k>=1)
A191667=dispersion of A016813 (4k+1, k>=1)
A191668=dispersion of A016825 (4k+2, k>=0)
A191669=dispersion of A004767 (4k+3, k>=0)
A191670=dispersion of A042968 (1 or 2 or 3 mod 4 and >=2)
A191671=dispersion of A004772 (0 or 1 or 3 mod 4 and >=2)
A191672=dispersion of A004773 (0 or 1 or 2 mod 4 and >=2)
A191673=dispersion of A004773 (0 or 2 or 3 mod 4 and >=2)
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
A191452 has 1st col A042968, all else A008486
A191667 has 1st col A004772, all else A016813
A191668 has 1st col A042965, all else A016825
A191669 has 1st col A004773, all else A004767
A191670 has 1st col A008486, all else A042968
A191671 has 1st col A016813, all else A004772
A191672 has 1st col A016825, all else A042965
A191673 has 1st col A004767, all else A004773
...
Regarding the dispersions A191670-A191673, there is a formula for sequences of the type "(a or b or c mod m)", (as in the Mathematica program below):
If f(n)=(n mod 3), then (a,b,c,a,b,c,a,b,c,...) is given by
a*f(n+2)+b*f(n+1)+c*f(n), so that "(a or b or c mod m)" is given by
a*f(n+2)+b*f(n+1)+c*f(n)+m*floor((n-1)/3)), for n>=1.

Examples

			Northwest corner:
1...3....11....43....171
2...7....27....107...427
4...15...59....235...939
5...19...75....299...1195
6...23...91....363...1451
		

Crossrefs

Row 1: A007583, Row 2: A136412.

Programs

  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r = 40; r1 = 12; c = 40; c1 = 12;
    f[n_] := 4*n-1
    Table[f[n], {n, 1, 30}] (* A004767 *)
    mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]
    rows = {NestList[f, 1, c]};
    Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
    t[i_, j_] := rows[[i, j]];
    TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191669 *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191669 *)

A303448 Numbers m such that both m and (m-1)/2 are Fermat pseudoprimes base 2 (A001567).

Original entry on oeis.org

19781763, 46912496118443, 192153584101141163
Offset: 1

Views

Author

Max Alekseyev, Apr 24 2018

Keywords

Comments

No other terms below 2^65.
Terms a(2) and a(3) are of the form (2^(2k+1)+1)/3 = A007583(k).
Terms A007583(k) belong to this sequence for k in A303009. Correspondingly, a(4) <= A007583(A303009(3)) = (2^83+1)/3 = 3223802185639011132549803.
If a(n) is not divisible by 3, then it also belongs to A175625.

Crossrefs

Numbers (a(n)-1)/2 are listed in A303447.
Subsequence of A006970 and A300193.

Formula

a(n) = 2*A303447(n) + 1.

Extensions

a(1) from Amiram Eldar, Jan 26 2018

A256265 Sums of two successive terms of A256264.

Original entry on oeis.org

1, 3, 7, 11, 15, 23, 35, 43, 47, 55, 67, 79, 95, 123, 155, 171, 175, 183, 195, 207, 223, 251, 283, 303, 319, 347, 387, 439, 503, 579, 651, 683, 687, 695, 707, 719, 735, 763, 795, 815, 831, 859, 899, 951, 1015, 1091, 1163, 1199, 1215, 1243, 1283, 1335, 1399, 1475, 1563, 1663, 1775, 1899, 2035, 2183, 2343, 2515, 2667, 2731
Offset: 1

Views

Author

Omar E. Pol, Apr 10 2015

Keywords

Comments

First differs from A139250 (the toothpick sequence) at a(27).
It appears that both sequences share infinitely many terms, for example: a(1)..a(26), a(31)..a(42), a(47)..a(50), a(63)..a(74), a(79)..a(82), etc.
The main entry for this sequence is A256263.

Crossrefs

Formula

a(n) = A256264(n) + A256264(n-1).

A292849 a(n) is the least positive k such that the Hamming weight of k equals the Hamming weight of k*n.

Original entry on oeis.org

1, 1, 3, 1, 7, 3, 7, 1, 15, 7, 3, 3, 5, 7, 15, 1, 31, 15, 7, 7, 13, 3, 7, 3, 31, 5, 31, 7, 31, 15, 31, 1, 63, 31, 11, 15, 7, 7, 7, 7, 57, 13, 3, 3, 23, 7, 11, 3, 21, 31, 43, 5, 39, 31, 7, 7, 9, 31, 35, 15, 21, 31, 63, 1, 127, 63, 23, 31, 15, 11, 15, 15, 29, 7
Offset: 1

Views

Author

Rémy Sigrist and Altug Alkan, Sep 25 2017

Keywords

Comments

The Hamming weight of a number n is given by A000120(n).
All terms are odd.
Numbers n such that a(n) is not squarefree are 33, 57, 63, 66, 83, 114, 115, 126, 132, 153, 155, ...
Numbers n such that a(n) > n are 5, 9, 17, 25, 27, 29, 33, 41, 65, 97, 101, 109, 113, ...
a(n) = 1 iff n = 2^i for some i >= 0.
a(n) = 3 iff n = A007583(i) * 2^j for some i > 0 and j >= 0.
Apparently:
- if n < 2^k then a(n) < 2^k,
- a(n) = n iff n = A000225(i) for some i > 0.
Proof that a(n) < 2^k if n < 2^k (see preceding comment): We can assume that n is not a power of two and take k such that 2^(k-1) < n < 2^k (so that k is the number of binary digits of n). Now, n - 1 and 2^k - n have complementary binary digits, so the binary digits of (2^k - 1)*n = 2^k*(n - 1) + (2^k - n) consist of the k digits of n - 1 followed by the complementary digits. This implies that the number of binary 1's is k, so that (2^k - 1)*n and 2^k - 1 have the same number of 1's and a(n) <= 2^k - 1. - Pontus von Brömssen, Jan 01 2021
See also A180012 for the base 10 equivalent sequence.

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[Range[1, 2^8 + 1, 2], Equal @@ Thread[DigitCount[{#, # n}, 2, 1]] &], {n, 74}] (* Michael De Vlieger, Sep 25 2017 *)
  • PARI
    a(n) = forstep(k=1, oo, 2, if (hammingweight(k) == hammingweight(k*n), return (k)))
    
  • PARI
    a(n) = my(k=1); while ((hammingweight(k)) != hammingweight(k*n), k++); k;
    
  • Python
    from itertools import count
    def A292849(n): return next(k for k in count(1) if k.bit_count()==(k*n).bit_count()) # Chai Wah Wu, Mar 11 2025

Formula

a((2^m)*n) = a(n) for all m >= 0 and n >= 1.
a(2^m + 1) = 2^(m + 1) - 1 for all m >= 0.
a(2^m - 1) = 2^m - 1 for all m >= 1.
a(2^m) = 1 for all m >= 0.

A364216 Jacobsthal-Niven numbers: numbers that are divisible by the sum of the digits in their Jacobsthal representation (A280049).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 11, 12, 14, 15, 16, 20, 22, 24, 27, 28, 32, 33, 36, 40, 42, 43, 44, 45, 46, 48, 51, 52, 54, 56, 57, 60, 68, 72, 75, 76, 84, 86, 87, 88, 92, 93, 95, 96, 99, 100, 104, 105, 108, 112, 115, 117, 120, 125, 126, 128, 129, 132, 135, 136, 138, 140
Offset: 1

Views

Author

Amiram Eldar, Jul 14 2023

Keywords

Comments

Numbers k such that A364215(k) | k.
A007583 is a subsequence since A364215(A007583(n)) = 1 for n >= 0.

Crossrefs

Programs

  • Mathematica
    seq[kmax_] := Module[{m = 1, s = {}}, Do[If[Divisible[k, DigitCount[m, 2, 1]], AppendTo[s, k]]; While[m++; OddQ[IntegerExponent[m, 2]]], {k, 1, kmax}]; s]; seq[140]
  • PARI
    lista(kmax) = {my(m = 1); for(k = 1, kmax, if( !(k % sumdigits(m, 2)), print1(k,", ")); until(valuation(m, 2)%2 == 0, m++));}

A364217 Numbers k such that k and k+1 are both Jacobsthal-Niven numbers (A364216).

Original entry on oeis.org

1, 2, 3, 8, 11, 14, 15, 27, 32, 42, 43, 44, 45, 51, 56, 75, 86, 87, 92, 95, 99, 104, 125, 128, 135, 144, 155, 171, 176, 182, 183, 195, 204, 264, 267, 275, 287, 305, 344, 363, 375, 387, 428, 444, 455, 474, 497, 512, 524, 535, 544, 545, 552, 555, 581, 605, 623, 639
Offset: 1

Views

Author

Amiram Eldar, Jul 14 2023

Keywords

Comments

A001045(2*n+1) = A007583(n) = (2^(2*n+1) + 1)/3 is a term for n >= 0, since its representation is 2*n 1's, so A364215(A001045(2*n+1)) = 1 divides A001045(2*n+1), and the representation of A001045(2*n+1) + 1 = (2^(2*n+1) + 4)/3 is max(2*n-1, 0) 0's between 2 1's, so A364215(A001045(2*n+1) + 1) = 2 which divides (2^(2*n+1) + 4)/3.

Crossrefs

Programs

  • Mathematica
    consecJacobsthalNiven[kmax_, len_] := Module[{m = 1, c = Table[False, {len}], s = {}}, Do[c = Join[Rest[c], {Divisible[k, DigitCount[m, 2, 1]]}]; While[m++; OddQ[IntegerExponent[m, 2]]]; If[And @@ c, AppendTo[s, k - len + 1]], {k, 1, kmax}]; s]; consecJacobsthalNiven[640, 2]
  • PARI
    lista(kmax, len) = {my(m = 1, c = vector(len)); for(k = 1, kmax, c = concat(vecextract(c, "^1"), !(k % sumdigits(m, 2))); until(valuation(m, 2)%2 == 0, m++); if(vecsum(c) == len, print1(k-len+1, ", ")));}
    lista(640, 2)

A082685 (2*5^n + 2^n)/3.

Original entry on oeis.org

1, 4, 18, 86, 422, 2094, 10438, 52126, 260502, 1302254, 6510758, 32552766, 162761782, 813804814, 4069015878, 20345063006, 101725282262, 508626345774, 2543131597798, 12715657726846, 63578288109942, 317891439501134
Offset: 0

Views

Author

Paul Barry, Apr 11 2003

Keywords

Comments

Binomial transform of A007583
Row sums of A114195. - Paul Barry, Nov 16 2005

Crossrefs

Cf. A001045.

Programs

  • Mathematica
    Table[(2*5^n+2^n)/3,{n,0,30}] (* or *) LinearRecurrence[{7,-10},{1,4},30] (* Harvey P. Dale, Apr 09 2014 *)
    CoefficientList[Series[(1 - 3 x)/((1 - 5 x) (1 - 2 x)), {x, 0, 50}], x] (* Vincenzo Librandi, Apr 10 2014 *)
  • PARI
    a(n)=(2*5^n+2^n)/3 \\ Charles R Greathouse IV, Oct 07 2015

Formula

G.f.: (1-3x)/((1-5x)(1-2x))
a(n)=sum{k=0..n, sum{j=0..n, C(n, j)C(j+k, 2k)2^(j-k)}}. - Paul Barry, Nov 16 2005
a(0)=1, a(1)=4, a(n)=7*a(n-1)-10*a(n-2). - Harvey P. Dale, Apr 09 2014

A156760 5*4^n-1.

Original entry on oeis.org

4, 19, 79, 319, 1279, 5119, 20479, 81919, 327679, 1310719, 5242879, 20971519, 83886079, 335544319, 1342177279, 5368709119, 21474836479, 85899345919, 343597383679, 1374389534719, 5497558138879, 21990232555519, 87960930222079, 351843720888319
Offset: 0

Views

Author

Paul Curtz, Feb 15 2009

Keywords

Comments

Second column of the array A132207, or, if this array is flattened, a(n)=A132207(A007583(n)).

Examples

			Binary.......................................Decimal
100................................................4
10011.............................................19
1001111...........................................79
100111111........................................319
10011111111.....................................1279
1001111111111...................................5119
100111111111111................................20479
10011111111111111..............................81919
1001111111111111111...........................327679
100111111111111111111........................1310719
10011111111111111111111......................5242879
1001111111111111111111111...................20971519
100111111111111111111111111.................83886079
10011111111111111111111111111..............335544319
1001111111111111111111111111111...........1342177279
... - _Philippe Deléham_, Feb 23 2014
		

Programs

Formula

a(n) mod 9 = A070403(n+2).
a(n+1) = 10*A083420(n)+9 .
a(n) = 5*A000302(n)-1.
a(n) = ( A024036(n+1)+A140529(n) )/2.
a(n) = 4a(n-1)+3, a(0)=4.
a(n) = A003947(n+1)-1 = 5*a(n-1)-4*a(n-2). G.f.: (4-x)/((1-x)(1-4x)). - R. J. Mathar, Feb 23 2009
a(n) = A198693(n) + 2^(2n+1). - Bob Selcoe, Apr 20 2015

Extensions

Edited and extended by R. J. Mathar, Feb 23 2009

A377627 Cogrowth sequence of the 12-element group C6 X C2 = .

Original entry on oeis.org

1, 1, 1, 2, 29, 211, 926, 3095, 9829, 37130, 164921, 728575, 2973350, 11450531, 43942081, 174174002, 708653429, 2884834891, 11582386286, 46006694735, 182670807229, 729520967450, 2926800830801, 11743814559415, 47006639297270, 187791199242011, 750176293590361
Offset: 0

Views

Author

Sean A. Irvine, Nov 02 2024

Keywords

Comments

Gives the even terms, all the odd terms are 0.

Examples

			a(2)=1 corresponds to the word TTTT.
a(3)=2 corresponds to the words SSSSSS and TTTTTT.
		

Crossrefs

Cf. A007583 (D6), A377626 (A4), A377656 (Dic12), A377714 (C4 X C2), A377840 (C8 X C2).

Formula

G.f.: (6*x^5+5*x^4+11*x^3-10*x^2+5*x-1) / ((4*x-1) * (x^2+x+1) * (9*x^2-3*x+1)).
Previous Showing 41-50 of 102 results. Next