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

A090310 a(n) = 21*a(n-1) + a(n-2), starting with a(0) = 2 and a(1) = 21.

Original entry on oeis.org

2, 21, 443, 9324, 196247, 4130511, 86936978, 1829807049, 38512885007, 810600392196, 17061121121123, 359094143935779, 7558038143772482, 159077895163157901, 3348193836570088403, 70471148463135014364
Offset: 0

Views

Author

Nikolay V. Kosinov (kosinov(AT)unitron.com.ua), Jan 25 2004

Keywords

Comments

Lim_{n-> infinity} a(n)/a(n+1) = 0.0475115... = 2/(21+sqrt(445)) = (sqrt(445)-21)/2.
Lim_{n-> infinity} a(n+1)/a(n) = 21.0475115... = (21+sqrt(445))/2 = 2/(sqrt(445)-21).
a(2) = 443 divides a(14) = 3348193836570088403. Does this relate to the sequence being the (21,1)-weighted Fibonacci sequence with seed (2,21) and both 14 and 21 being multiples of 7? Primes in this sequence include: a(0) = 2, a(2) = 443, a(4) = 196247 Semiprimes in this sequence include: a(8) = 38512885007 = 97967 * 393121, a(14) = 3348193836570088403 = 443 * 7557999631083721. - Jonathan Vos Post, Feb 10 2005

Examples

			a(4) = 21*a(3) + a(2) = 21*9324 + 443 = ((21+sqrt(445))/2)^4 + ((21-sqrt(445))/2)^4 = 196246.9999949043 + 0.0000050956 = 196247.
		

Crossrefs

Lucas polynomials Lucas(n,m): A000032 (m=1), A002203 (m=2), A006497 (m=3), A014448 (m=4), A087130 (m=5), A085447 (m=6), A086902 (m=7), A086594 (m=8), A087798 (m=9), A086927 (m=10), A001946 (m=11), A086928 (m=12), A088316 (m=13), A090300 (m=14), A090301 (m=15), A090305 (m=16), A090306 (m=17), A090307 (m=18), A090308 (m=19), A090309 (m=20), this sequence (m=21), A090313 (m=22), A090314 (m=23), A090316 (m=24), A330767 (m=25).

Programs

  • GAP
    m:=21;; a:=[2,m];; for n in [3..20] do a[n]:=m*a[n-1]+a[n-2]; od; a; # G. C. Greubel, Dec 30 2019
  • Magma
    m:=21; I:=[2,m]; [n le 2 select I[n] else m*Self(n-1) +Self(n-2): n in [1..20]]; // G. C. Greubel, Dec 30 2019
    
  • Maple
    seq(simplify(2*(-I)^n*ChebyshevT(n, 21*I/2)), n = 0..20); # G. C. Greubel, Dec 30 2019
  • Mathematica
    LinearRecurrence[{21,1},{2,21},40] (* or *) CoefficientList[ Series[ (2-21x)/(1-21x-x^2),{x,0,40}],x]  (* Harvey P. Dale, Apr 24 2011 *)
    LucasL[Range[20]-1,21] (* G. C. Greubel, Dec 30 2019 *)
  • PARI
    vector(21, n, 2*(-I)^(n-1)*polchebyshev(n-1, 1, 21*I/2) ) \\ G. C. Greubel, Dec 30 2019
    
  • Sage
    [2*(-I)^n*chebyshev_T(n, 21*I/2) for n in (0..20)] # G. C. Greubel, Dec 30 2019
    

Formula

a(n) = 21*a(n-1) + a(n-2), starting with a(0) = 2 and a(1) = 21.
a(n) = ((21+sqrt(445))/2)^n + ((21-sqrt(445))/2)^n.
(a(n))^2 = a(2n) - 2 if n=1, 3, 5... .
(a(n))^2 = a(2n) + 2 if n=2, 4, 6... .
G.f.: (2-21*x)/(1-21*x-x^2). - Philippe Deléham, Nov 02 2008
a(n) = Lucas(n, 21) = 2*(-i)^n * ChebyshevT(n, 21*i/2). - G. C. Greubel, Dec 30 2019

Extensions

More terms from Ray Chandler, Feb 14 2004

A014841 Sum modulo the base of all the digits of n in every base from 2 to n-1.

Original entry on oeis.org

0, 3, 2, 7, 6, 13, 13, 18, 19, 31, 24, 37, 40, 48, 48, 65, 59, 79, 76, 85, 93, 117, 105, 121, 132, 148, 143, 176, 163, 193, 191, 208, 226, 250, 225, 262, 277, 302, 290, 332, 320, 359, 363, 376, 394, 444, 419, 455, 462, 491, 495, 551, 540, 577, 564, 601, 625
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Mod[Total[IntegerDigits[n,i]], i], {i,2,n-1}], {n,3,59}] (* Stefano Spezia, Sep 06 2022 *)
  • PARI
    a(n) = sum(b=2, n-1, sumdigits(n, b) % b); \\ Michel Marcus, Sep 06 2022
    
  • Python
    from sympy.ntheory import digits
    def a(n): return sum(sum(digits(n, b)[1:])%b for b in range(2, n))
    print([a(n) for n in range(3, 60)]) # Michael S. Branicky, Sep 06 2022

A014840 Sum of all the digits of n in every base prime to n from 2 to n-1.

Original entry on oeis.org

2, 2, 7, 2, 15, 10, 15, 8, 34, 12, 45, 22, 31, 32, 73, 28, 90, 40, 57, 50, 135, 46, 118, 74, 117, 70, 198, 58, 222, 120, 139, 122, 192, 92, 296, 152, 216, 136, 372, 112, 408, 202, 235, 208, 497, 176, 442, 224, 338, 260, 607, 202, 454, 276, 416, 330, 755, 194, 776
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local b;
     add(convert(convert(n,base,b),`+`), b = select(t -> igcd(t,n)=1, [$2..n-1]))
    end proc:
    map(f, [$3..100]); # Robert Israel, Nov 08 2024
  • Mathematica
    Table[Sum[If[CoprimeQ[i, n], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}], {n, 3, 61}] (* Stefano Spezia, Sep 06 2022 *)
  • PARI
    a(n) = {s = 0; for (i=2, n-1, if (gcd(i, n) == 1, d = digits(n, i); s += sum(j=1, #d, d[j]););); s;} \\ Michel Marcus, May 30 2014
    
  • Python
    from math import gcd
    from sympy.ntheory import digits
    def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n) if gcd(b, n) == 1)
    print([a(n) for n in range(3, 62)]) # Michael S. Branicky, Sep 06 2022

A014838 Sum of all the digits of n in every prime base from 2 to n-1.

Original entry on oeis.org

2, 3, 5, 6, 9, 11, 11, 10, 14, 16, 21, 21, 21, 23, 29, 32, 39, 42, 42, 39, 47, 52, 53, 49, 52, 53, 62, 66, 76, 83, 82, 76, 77, 82, 93, 87, 85, 90, 102, 107, 120, 123, 129, 120, 134, 144, 147, 153, 150, 151, 166, 176, 178, 185, 181, 168, 184, 194, 211, 199, 207
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[If[PrimeQ[i], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}],{n, 3, 63}] (* Stefano Spezia, Sep 06 2022 *)
  • PARI
    a(n) = {s = 0; forprime (i=2, n-1, d = digits(n, i); s += sum(j=1, #d, d[j]);); s;} \\ Michel Marcus, May 30 2014
    
  • Python
    from sympy.ntheory import digits, isprime
    def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n) if isprime(b))
    print([a(n) for n in range(3, 64)]) # Michael S. Branicky, Sep 06 2022

A014839 Sum of all the digits of n in every prime-power base from 2 to n-1.

Original entry on oeis.org

2, 3, 7, 9, 13, 13, 16, 19, 26, 28, 36, 39, 42, 34, 45, 44, 55, 59, 63, 64, 76, 75, 80, 82, 82, 87, 102, 112, 128, 113, 120, 121, 129, 130, 148, 149, 154, 156, 175, 187, 207, 214, 219, 217, 238, 227, 237, 228, 233, 239, 262, 246, 256, 261, 265, 260, 284, 299
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[If[PrimePowerQ[i], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}], {n, 3, 60}] (* Stefano Spezia, Sep 06 2022 *)
Showing 1-5 of 5 results.