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

A037497 Base-4 digits are, in order, the first n terms of the periodic sequence with initial period 1,0,2.

Original entry on oeis.org

1, 4, 18, 73, 292, 1170, 4681, 18724, 74898, 299593, 1198372, 4793490, 19173961, 76695844, 306783378, 1227133513, 4908534052, 19634136210, 78536544841, 314146179364, 1256584717458, 5026338869833, 20105355479332, 80421421917330
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    I:=[1, 4, 18, 73]; [n le 4 select I[n] else 4*Self(n-1)+Self(n-3)-4*Self(n-4): n in [1..30]]; // Vincenzo Librandi, Jun 22 2012
    
  • Mathematica
    LinearRecurrence[{4, 0, 1, -4}, {1, 4, 18, 73}, 40] (* or *) CoefficientList[Series[(1 + 2 x^2)/((1 - x)(1 - 4 x) (1 + x + x^2)),{x,0,40}],x] (* Vincenzo Librandi, Jun 22 2012 *)
  • Python
    print([2*4**n//7 for n in range(1, 25)]) # Karl V. Keller, Jr., Sep 22 2020

Formula

From Vincenzo Librandi, Jun 22 2012: (Start)
G.f.: x*(1+2*x^2)/((1-x)*(1-4*x)*(1+x+x^2)).
a(n) = 4*a(n-1) + a(n-3) - 4*a(n-4). (End)
a(n) = floor(2*4^n/7). - Karl V. Keller, Jr., Sep 22 2020

A037503 Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 1,0,2.

Original entry on oeis.org

1, 10, 102, 1021, 10210, 102102, 1021021, 10210210, 102102102, 1021021021, 10210210210, 102102102102, 1021021021021, 10210210210210, 102102102102102, 1021021021021021
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • PARI
    Vec(x*(1+2*x^2)/((x-1)*(10*x-1)*(1+x+x^2)) + O(x^25)) \\ Jinyuan Wang, Apr 14 2020

Formula

G.f.: x*(1+2*x^2) / ( (x-1)*(10*x-1)*(1+x+x^2) ). - R. J. Mathar, Aug 12 2013
a(n) = 10*a(n-1) + a(n-3) - 10*a(n-4). - Wesley Ivan Hurt, Sep 22 2020

A369635 Numbers in whose base 3-representation every two consecutive digits and every three consecutive digits are distinct.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 11, 15, 19, 21, 34, 46, 59, 65, 102, 140, 177, 202, 308, 420, 532, 606, 925, 1261, 1598, 1820, 2775, 3785, 4794, 5467, 8327, 11355, 14383, 16401, 24982, 34066, 43151, 49205, 74946, 102200, 129453, 147622, 224840, 306600, 388360, 442866
Offset: 1

Views

Author

Clark Kimberling, Feb 26 2024

Keywords

Comments

In other words, the ternary expansion of the number does not contain any string xx or xxx.
The first eleven terms of this sequence comprise the base-3 xenodrome, A023798.
Ordered union of {0}, A037496, A037504, A037512, and A037520.

Examples

			The base-3 representation of 7 is 21, in which every two consecutive digits are distinct, so 7 is a term of the sequence.
The base-3 representation of 532 is 201201, in which every 3 consecutive digits are distinct, so 532 is a term of the sequence.
		

Crossrefs

Programs

  • Mathematica
    s1 = LinearRecurrence[{3, 0, 1, -3}, {0, 1, 3, 11}, 30]  (* A037496 *)
    s2 = LinearRecurrence[{3, 0, 1, -3}, {0, 1, 5, 15}, 30]  (* A037504 *)
    s3 = LinearRecurrence[{3, 0, 1, -3}, {0, 2, 6, 19}, 30]  (* A037512 *)
    s4 = LinearRecurrence[{3, 0, 1, -3}, {0, 7, 21, 65}, 30] (* A037520 *)
    s = Union[s1, s2, s3, s4]
Showing 1-3 of 3 results.