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-10 of 11 results. Next

A045873 a(n) = A006496(n)/2.

Original entry on oeis.org

0, 1, 2, -1, -12, -19, 22, 139, 168, -359, -1558, -1321, 5148, 16901, 8062, -68381, -177072, -12239, 860882, 1782959, -738492, -10391779, -17091098, 17776699, 121008888, 153134281, -298775878, -1363223161, -1232566932
Offset: 0

Views

Author

Keywords

Comments

Partial sums of A006495. - Paul Barry, Mar 16 2006
This is the Lucas U(P=2,Q=5) sequence. - R. J. Mathar, Oct 24 2012
With different signs, 0, 1, -2, -1, 12, -19, -22, 139, -168, -359, 1558, ... we obtain the Lucas U(-2,5) sequence. - R. J. Mathar, Jan 08 2013

Crossrefs

Programs

  • GAP
    a:=[0,1];; for n in [3..30] do a[n]:=2*a[n-1]-5*a[n-2]; od; a; # Muniru A Asiru, Oct 23 2018
    
  • Magma
    I:=[0,1]; [n le 2 select I[n] else 2*Self(n-1) - 5*Self(n-2): n in [1..50]]; // G. C. Greubel, Oct 22 2018
    
  • Maple
    seq(coeff(series(x/(1-2*x+5*x^2),x,n+1), x, n), n = 0 .. 30); # Muniru A Asiru, Oct 23 2018
  • Mathematica
    LinearRecurrence[{2,-5}, {0,1}, 40] (* G. C. Greubel, Jan 11 2024 *)
  • PARI
    concat(0,Vec(1/(1-2*x+5*x^2)+O(x^99))) \\ Charles R Greathouse IV, Dec 22 2011
    
  • Sage
    [lucas_number1(n,2,5) for n in range(0, 29)] # Zerinvary Lajos, Apr 23 2009
    
  • SageMath
    A045873=BinaryRecurrenceSequence(2,-5,0,1)
    [A045873(n) for n in range(41)] # G. C. Greubel, Jan 11 2024

Formula

a(n)^2 = A094423(n).
From Paul Barry, Sep 20 2003: (Start)
O.g.f.: x/(1 - 2*x + 5*x^2).
E.g.f.: exp(x)*sin(2*x)/2.
a(n) = 2*a(n-1) - 5*a(n-2), a(0)=0, a(1)=1.
a(n) = ((1 + 2*i)^n - (1 - 2*i)^n)/(4*i), where i=sqrt(-1).
a(n) = Im{(1 + 2*i)^n/2}.
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2k+1)*(-4)^k. (End)
a(n+1) = Sum_{k=0..n} binomial(k,n-k)*2^k*(-5/2)^(n-k). - Paul Barry, Mar 16 2006
G.f.: 1/(4*x - 1/G(0)) where G(k) = 1 - (k+1)/(1 - x/(x - (k+1)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Dec 06 2012
G.f.: Q(0)*x/2, where Q(k) = 1 + 1/(1 - x*(4*k+2 - 5*x)/( x*(4*k+4 - 5*x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 30 2013
a(n) = 5^((n-1)/2)*ChebyshevU(n-1, 1/sqrt(5)). - G. C. Greubel, Jan 11 2024

Extensions

More terms from Paul Barry, Sep 20 2003

A088133 Sum of first and last digits of n. Different from A115299.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14
Offset: 0

Views

Author

Zak Seidov, Sep 20 2003

Keywords

Crossrefs

Cf. A000030 (first digit of n), A010879 (last digit of n).

Programs

  • Mathematica
    Total[{First[IntegerDigits[#]],Last[IntegerDigits[#]]}]&/@Range[90] (* Harvey P. Dale, Aug 21 2018 *)
  • PARI
    apply( {A088133(n)=n\10^logint(n+!n, 10)+n%10}, [0..99]) \\ M. F. Hasler, Apr 22 2024
    
  • Python
    list(map(A088133 := lambda n: int(str(n)[0])+n%10, range(99))) # M. F. Hasler, Apr 22 2024

Formula

a(n) = A000030(n) + A010879(n). - M. F. Hasler, Apr 22 2024

Extensions

Extended to a(0) = 0 by M. F. Hasler, Apr 22 2024

A088134 Numbers n such that sum of first and last digits is prime.

Original entry on oeis.org

1, 11, 12, 14, 16, 20, 21, 23, 25, 29, 30, 32, 34, 38, 41, 43, 47, 49, 50, 52, 56, 58, 61, 65, 67, 70, 74, 76, 83, 85, 89, 92, 94, 98, 101, 102, 104, 106, 111, 112, 114, 116, 121, 122, 124, 126, 131, 132, 134, 136, 141, 142, 144, 146, 151, 152, 154, 156, 161, 162, 164
Offset: 1

Views

Author

Zak Seidov, Sep 20 2003

Keywords

Crossrefs

A088139 a(n) = 2*a(n-1) - 6*a(n-2), a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 2, -2, -16, -20, 56, 232, 128, -1136, -3040, 736, 19712, 35008, -48256, -306560, -323584, 1192192, 4325888, 1498624, -22958080, -54907904, 27932672, 385312768, 603029504, -1105817600, -5829812224, -5024718848, 24929435648, 80007184384
Offset: 0

Views

Author

Paul Barry, Sep 20 2003

Keywords

Crossrefs

Programs

  • GAP
    a:=[0,1];; for n in [3..30] do a[n]:=2*a[n-1]-6*a[n-2]; od; a; # Muniru A Asiru, Oct 23 2018
  • Magma
    I:=[0,1]; [n le 2 select I[n] else 2*Self(n-1) - 6*Self(n-2): n in [1..30]]; // G. C. Greubel, Oct 22 2018
    
  • Maple
    seq(coeff(series(x/(1-2*x+6*x^2),x,n+1), x, n), n = 0 .. 30); # Muniru A Asiru, Oct 23 2018
  • Mathematica
    Join[{a=0,b=1},Table[c=2*b-6*a;a=b;b=c,{n,100}]] (* Vladimir Joseph Stephan Orlovsky, Jan 17 2011*)
    TrigExpand@Table[(6^(n/2) Sin[n ArcTan[Sqrt[5]]])/Sqrt[5], {n, 0, 20}] (* or *)
    Table[Sum[(-5)^k Binomial[n, 2 k + 1], {k, 0, n/2}], {n, 0, 20}] (* Vladimir Reshetnikov, Sep 20 2016 *)
    LinearRecurrence[{2,-6},{0,1},40] (* Harvey P. Dale, Nov 22 2024 *)
  • PARI
    x='x+O('x^30); concat([0], Vec(x/(1-2*x+6*x^2))) \\ G. C. Greubel, Oct 22 2018
    
  • Sage
    [lucas_number1(n,2,6) for n in range(0, 30)] # Zerinvary Lajos, Apr 23 2009
    

Formula

G.f.: x/(1-2*x+6*x^2).
E.g.f.: exp(x)*sin(sqrt(5)*x)/sqrt(5).
a(n) = ((1+i*sqrt(5))^n-(1-i*sqrt(5))^n)/(2*i*sqrt(5)).
a(n) = Im{(1+i*sqrt(5))^n/sqrt(5)}.
a(n) = Sum_{k=0..floor(n/2)} C(n, 2k+1)(-5)^k.
a(n+1) = (-1)^n*Sum_{k, 0<=k<=n} A172250(n,k)*(-2)^k. - Philippe Deléham, Feb 15 2012

A088135 Sum of first and last digits of n-th prime.

Original entry on oeis.org

4, 6, 10, 14, 2, 4, 8, 10, 5, 11, 4, 10, 5, 7, 11, 8, 14, 7, 13, 8, 10, 16, 11, 17, 16, 2, 4, 8, 10, 4, 8, 2, 8, 10, 10, 2, 8, 4, 8, 4, 10, 2, 2, 4, 8, 10, 3, 5, 9, 11, 5, 11, 3, 3, 9, 5, 11, 3, 9, 3, 5, 5, 10, 4, 6, 10, 4, 10, 10, 12, 6, 12, 10, 6, 12, 6, 12, 10, 5, 13, 13, 5, 5, 7, 13, 7, 13
Offset: 1

Views

Author

Zak Seidov, Sep 20 2003

Keywords

Crossrefs

Programs

  • Mathematica
    sfl[p_]:=Module[{idn=IntegerDigits[p]},idn[[1]]+idn[[-1]]]; sfl/@Prime[Range[90]] (* Harvey P. Dale, Jan 31 2023 *)

A108660 Square-loop primes.

Original entry on oeis.org

2, 13, 31, 79, 97, 227, 881, 1013, 2797, 3181, 3631, 8101, 22727, 81001, 101363, 109013, 131363, 181813, 272227, 310181, 310901, 318181, 318881, 631013, 636313, 810401, 818101, 901097, 904097, 972227, 1018813, 1090013, 1810013, 2272727
Offset: 1

Views

Author

Zak Seidov, Jun 16 2005

Keywords

Comments

Primes such that each pair of adjacent digits (and also the first and the last ones) sums up to a square. First term is arguable since there is 'no pair of adjacent digits', but there are the "first" and "last" digits.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200000]],And@@(IntegerQ[Sqrt[#]]&/@(Total/@Partition[ IntegerDigits[#],2,1,1]))&] (* Harvey P. Dale, Mar 03 2014 *)

A108659 Square-chain primes (including square-loop primes).

Original entry on oeis.org

2, 13, 31, 79, 97, 101, 109, 131, 181, 227, 313, 401, 409, 631, 727, 797, 881, 1009, 1013, 1097, 2797, 3109, 3181, 3631, 4001, 4013, 7901, 8101, 9001, 9013, 10009, 10181, 10909, 10979, 13109, 18131, 18181, 22279, 22727, 27901, 31013, 36313
Offset: 1

Views

Author

Zak Seidov, Jun 16 2005

Keywords

Comments

Primes such that each pair of adjacent digits sums up to a square. First term is a square-loop prime, cf. A108660.

Crossrefs

Programs

  • Mathematica
    Join[{2},Select[Prime[Range[5,4000]],PrimeQ[#]&&AllTrue[Sqrt[#]&/@(Total/@Partition[ IntegerDigits[ #],2,1]),IntegerQ]&]] (* Harvey P. Dale, Jun 02 2024 *)

A109981 Primes such that both the sum of digits and the number of digits are primes.

Original entry on oeis.org

11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 113, 131, 137, 139, 151, 157, 173, 179, 191, 193, 197, 199, 223, 227, 229, 241, 263, 269, 281, 283, 311, 313, 317, 331, 337, 353, 359, 373, 379, 397, 401, 409, 421, 443, 449, 461, 463, 467, 487, 557, 571, 577, 593
Offset: 1

Views

Author

Zak Seidov, Jul 06 2005

Keywords

Comments

Cf. A046704 Additive primes: sum of digits is a prime, A088136 Primes such that sum of first and last digits is prime.

Examples

			a(86) = 10037 because both the sum (=11) and number (=5) of digits are primes.
		

Crossrefs

Programs

  • Haskell
    a109981 n = a109981_list !! (n-1)
    a109981_list = filter ((== 1) . a010051' . a055642) a046704_list
    -- Reinhard Zumkeller, Nov 16 2012
  • Mathematica
    Select[Prime[Range[200]], PrimeQ[Length[IntegerDigits[ # ]]]&&PrimeQ[Plus@@IntegerDigits[ # ]]&]

A109982 Primes p such that index of p, the sum of p's digits and the number of p's digits are all primes.

Original entry on oeis.org

11, 41, 67, 83, 157, 179, 191, 241, 283, 331, 353, 401, 461, 599, 739, 773, 797, 919, 991, 10079, 10169, 10433, 10457, 10589, 10631, 10723, 10853, 10909, 11311, 11447, 11867, 11953, 12097, 12143, 12301, 12457, 12479, 12503, 12547, 12763, 13003
Offset: 1

Views

Author

Zak Seidov, Jul 06 2005

Keywords

Examples

			a(414) = 99551 because its index, 9551, the sum, 29 and number, 5, of digits are all primes.
		

Crossrefs

Cf. A046704 Additive primes: sum of digits is a prime, A088136 Primes such that sum of first and last digits is prime, A109981 Primes such that the sum of digits and the number of digits are primes.

Programs

  • Mathematica
    Select[Prime[Range[200]], PrimeQ[Length[IntegerDigits[ # ]]]&&PrimeQ[Plus@@IntegerDigits[ # ]]&]
    Select[Prime[Range[1600]],AllTrue[{PrimePi[#],Total[IntegerDigits[#]], IntegerLength[ #]}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 15 2019 *)

A086924 Primes such that sum of the first and last digits is a square.

Original entry on oeis.org

2, 13, 31, 79, 97, 103, 113, 163, 173, 193, 227, 257, 277, 311, 331, 613, 643, 653, 673, 683, 709, 719, 739, 769, 811, 821, 881, 907, 937, 947, 967, 977, 997, 1013, 1033, 1063, 1093, 1103, 1123, 1153, 1163, 1193, 1213, 1223
Offset: 1

Views

Author

Zak Seidov, Sep 20 2003

Keywords

Crossrefs

Programs

  • Mathematica
    fldsQ[n_]:=Module[{idn=IntegerDigits[n]},IntegerQ[Sqrt[ idn[[1]] + idn[[-1]]]]]; Select[Prime[Range[200]],fldsQ] (* Harvey P. Dale, Aug 12 2017 *)
  • PARI
    okdigs(n) = digs = digits(n); issquare(digs[1]+digs[#digs]);
    isok(n) = isprime(n) && okdigs(n); \\ Michel Marcus, Oct 05 2013
Showing 1-10 of 11 results. Next