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.

A125144 Increments in the number of decimal digits of 4^n.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0
Offset: 1

Views

Author

Keywords

Comments

This sequence is not periodic because log(4)/log(10) is an irrational number. - T. D. Noe, Jan 25 2007

Examples

			a(1)=1 because 4^(1+1)=16 (two digits) 4^1=4 (one digit) and the difference is 1.
a(2)=0 because 4^(2+1)=64 (two digits) 4^(2)=16 (two digits) and the difference is 0.
		

Crossrefs

First differences of A210434.

Programs

  • Maple
    P:=proc(n) local i,j,k,w,old; k:=4; for i from 1 by 1 to n do j:=k^i; w:=0; while j>0 do w:=w+1; j:=trunc(j/10); od; if i>1 then print(w-old); old:=w; else old:=w; fi; od; end: P(1000);
    # alternative:
    H:= [seq(ilog10(4^i),i=1..1001)]:
    H[2..-1]-H[1..-2]; # Robert Israel, Jul 12 2018
  • Mathematica
    Differences[IntegerLength[4^Range[100]]] (* Paolo Xausa, Jun 08 2024 *)
  • PARI
    a(n) = #digits(4^(n+1)) - #digits(4^n); \\ Michel Marcus, Jul 12 2018

Formula

a(n)=Number_of_digits{4^(n+1)}-Number_of digits{4^(n)} with n>=0 and where "Number_of digits" is a hypothetical function giving the number of digits of the argument.

Extensions

Offset corrected by Robert Israel, Jul 11 2018

A271427 a(n) = 7^n - a(n-1) for n>0, a(0)=0.

Original entry on oeis.org

0, 7, 42, 301, 2100, 14707, 102942, 720601, 5044200, 35309407, 247165842, 1730160901, 12111126300, 84777884107, 593445188742, 4154116321201, 29078814248400, 203551699738807, 1424861898171642, 9974033287201501, 69818233010410500, 488727631072873507, 3421093417510114542
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 13 2016

Keywords

Comments

In general, the ordinary generating function for the recurrence b(n) = k^n - b(n-1), where n>0 and b(0)=0, is k*x/((1 + x)*(1 - k*x)). This recurrence gives the closed form b(n) = k*(k^n - (-1)^n)/(k + 1).

Examples

			a(2) = 7^2 - a(2-1) = 49 - 7 = 42.
a(4) = 7^4 - a(4-1) = 2401 - 301 = 2100.
		

Crossrefs

Cf. similar sequences with the recurrence b(n) = k^n - b(n-1): A125122 (k=1), A078008 (k=2), A054878 (k=3), A109499 (k=4), A109500 (k=5), A109501 (k=6), this sequence (k=7), A093134 (k=8), A001099 (k=n).

Programs

  • Mathematica
    LinearRecurrence[{6, 7}, {0, 7}, 30]
    Table[7 (7^n - (-1)^n)/8, {n, 0, 30}]
  • PARI
    vector(50, n, n--; 7*(7^n-(-1)^n)/8) \\ Altug Alkan, Apr 13 2016
    
  • Python
    for n in range(0,10**2):print((int)((7*(7**n-(-1)**n))/8))
    # Soumil Mandal, Apr 14 2016

Formula

O.g.f.: 7*x/(1 - 6*x - 7*x^2).
E.g.f.: (7/8)*(exp(7*x) - exp(-x)).
a(n) = 6*a(n-1) + 7*a(n-2).
a(n) = 7*(7^n - (-1)^n)/8.
a(n) = 7*A015552(n).
Sum_{n>0} 1/(a(n) + a(n-1)) = 1/6 = A020793.
Limit_{n->oo} a(n-1)/a(n) = 1/7 = A020806.
Showing 1-2 of 2 results.