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

A051109 Expansion of g.f. (1+2*x+5*x^2)/(1-10*x^3).

Original entry on oeis.org

1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000, 5000000, 10000000, 20000000, 50000000, 100000000, 200000000, 500000000, 1000000000, 2000000000, 5000000000, 10000000000, 20000000000, 50000000000
Offset: 0

Views

Author

Robert Lozyniak (11(AT)onna.com)

Keywords

Crossrefs

Cf. A117727.

Programs

  • Magma
    [(1 +(n mod 3)^2)*10^Floor(n/3): n in [0..40]]; // G. C. Greubel, Jul 23 2023
    
  • Mathematica
    a[n_]:= a[n]= If[n<3, Fibonacci[2n+1], 10*a[n-3]];
    Table[a[n], {n,0,40}] (* G. C. Greubel, Jul 23 2023 *)
  • Python
    print( [ ((n % 3) ** 2 + 1) * 10**int(n/3) for n in range(100)] )
    
  • SageMath
    [(1 +(n%3)^2)*10^(n//3) for n in range(41)] # G. C. Greubel, Jul 23 2023

Formula

a(3*n) = 10^n, a(3*n+1) = 2*10^n, a(3*n+2) = 5*10^n.
a(n) = ( 1 + (n mod 3)^2 )*10^floor(n/3). - Justin L. Brown (jlbrown(AT)neo.tamu.edu), Jun 17 2004
G.f.: (1+2*x+5*x^2)/(1-10*x^3). - Philippe Deléham, Apr 08 2013
a(n) = 10*a(n-3) with n>2, a(0)=1, a(1)=2, a(2)=5. - Philippe Deléham, Apr 08 2013
From Amiram Eldar, Jul 27 2023: (Start)
Sum_{n>=0} 1/a(n) = 17/9.
Sum_{n>=0} (-1)^n/a(n) = 7/11. (End)

Extensions

Second formula corrected by Peter C. Lauterbach, Nov 12 2010
New name using g.f. from Joerg Arndt, Jul 23 2023

A117713 a(1)=1, a(2)=3, a(3)=8; for n>=4, a(n) = 10*a(n-3) + 8 (if a(n-3) is odd) or + 9 (if a(n-3) is even).

Original entry on oeis.org

1, 3, 8, 18, 38, 89, 189, 389, 898, 1898, 3898, 8989, 18989, 38989, 89898, 189898, 389898, 898989, 1898989, 3898989, 8989898, 18989898, 38989898, 89898989, 189898989, 389898989, 898989898, 1898989898, 3898989898, 8989898989, 18989898989, 38989898989, 89898989898
Offset: 1

Views

Author

Louis Ciotti (lciotti(AT)twcny.rr.com), Apr 13 2006

Keywords

Comments

From a puzzle (1,3,8,18,?,89,189) given on a civil service test.
Another possibility is that 1,3,8,18,?,89,189,... is an erroneous version of A117727. - Hugo van der Sanden, Apr 14 2006

Crossrefs

Programs

  • Magma
    I:=[1,3,8,18,38,89,189]; [n le 7 select I[n] else Self(n-1) +9*Self(n-3) -9*Self(n-4) +10*Self(n-6) -10*Self(n-7): n in [1..40]]; // G. C. Greubel, Jul 23 2023
    
  • Maple
    f:=proc(n) option remember; local t1; if n=1 then RETURN(1); fi; if n=2 then RETURN(3); fi; if n=3 then RETURN(8); fi; t1:=10*f(n-3)+8; if f(n-3) mod 2 = 0 then t1:=t1+1; fi; RETURN(t1); end;
  • Mathematica
    a[n_]:= a[n]= If[n<4, Fibonacci[2*n], 10*a[n-3] +If[Mod[a[n-3], 2]==1, 8, 9]];
    Table[a[n], {n, 40}] (* G. C. Greubel, Jul 23 2023 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A117713
        if (n<4): return fibonacci(2*n)
        elif (a(n-3)%2)==1: return 10*a(n-3) + 8
        else: return 10*a(n-3) + 9
    [a(n) for n in range(1,41)] # G. C. Greubel, Jul 23 2023

Formula

From G. C. Greubel, Jul 23 2023: (Start)
a(n) = (1/198)*(2*(89*b(n) + 188*b(n-1) + 386*b(n-2)) + 6*(A010892(n) + A010892(n-1)) - 187 + 3*(-1)^n), where b(n) = 10^floor(n/3)*floor((n-1 mod 3)/2).
G.f.: x*(1 + 2*x + 5*x^2 + x^3 + 2*x^4 + 6*x^5)/((1-x^2)*(1-x+x^2)*(1-10*x^3)). (End)

Extensions

Solution proposed by Mohammed BOUAYOUN (mohammed.bouayoun(AT)yahoo.fr), Apr 14 2006
Showing 1-2 of 2 results.