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.

A122045 Euler (or secant) numbers E(n).

Original entry on oeis.org

1, 0, -1, 0, 5, 0, -61, 0, 1385, 0, -50521, 0, 2702765, 0, -199360981, 0, 19391512145, 0, -2404879675441, 0, 370371188237525, 0, -69348874393137901, 0, 15514534163557086905, 0, -4087072509293123892361, 0, 1252259641403629865468285, 0, -441543893249023104553682821
Offset: 0

Views

Author

Roger L. Bagula, Sep 13 2006

Keywords

Comments

The convention in the OEIS is that the alternate zeros are normally omitted in such sequences. See A000364 for the official version of this sequence.
Odd primes p such that p | E(p-1) are primes p == 1 (mod 4), A002144. Conjecture: odd composites m such that m | E(m-1) are Carmichael numbers m such that p == 1 (mod 4) for every prime p|m, A265237. - Thomas Ordowski, Feb 06 2020

Examples

			G.f. = 1 - x^2 + 5*x^4 - 61*x^6 + 1385*x^8 - 50521*x^10 + 2702765*x^12 + ...
		

References

  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 5, page 41.

Crossrefs

Programs

  • Magma
    m:=35; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!( 1/Cosh(x) )); [Factorial(n-1)*b[n]: n in [1..m-1]]; // G. C. Greubel, Feb 13 2020
    
  • Maple
    seq(euler(n) , n=0..31); # Zerinvary Lajos, Mar 15 2009
    P := proc(n,x) option remember; if n = 0 then 1 else
       (n*x+(1/2)*(1-x))*P(n-1,x)+x*(1-x)*diff(P(n-1,x),x); expand(%) fi end:
    A122045 := n -> (-1)^n*subs(x=-1, P(n,x)):
    seq(A122045(n), n=0..30);  # Peter Luschny, Mar 07 2014
    ptan := proc(n) option remember; if irem(n, 2) = 1 then 0 else
        -add(`if`(k=0, 1, binomial(n, k)*ptan(n - k)), k = 0..n-1,2) fi end:
    A122045 := n -> ifelse(n = 0, 1, ptan(n)):
    seq(A122045(n), n = 0..30); # Peter Luschny, Jun 06 2022
  • Mathematica
    Table[EulerE[n], {n, 0, 30}]
    Range[0, 30]! CoefficientList[ Series[ Sech[x], {x, 0, 30}], x] (* Robert G. Wilson v, Aug 08 2018 *)
    a[0] := 1; a[n_?OddQ] := 0; a[n_?EvenQ] := a[n] = -Sum[a[k] Binomial[n, k], {k, 0, n - 1, 2}]; Map[a, Range[0, 30]] (* Oliver Seipel, May 20 2024 *)
  • Maxima
    a[n]:=if n<2 then 1-n else sum(-a[n-2*k]*binomial(n,2*k),k,1,floor(n/2));
    makelist(a[n],n,0,50); /* Tani Akinari, Sep 15 2023 */
  • PARI
    x='x+O('x^66); Vec(serlaplace(1/cosh(x))) \\ Joerg Arndt, Mar 10 2014
    
  • PARI
    a(n) = 2^n*2^(n+1)*(subst(bernpol(n+1,x), x, 3/4) - subst(bernpol(n+1,x), x, 1/4))/(n+1); \\ Michel Marcus, May 20 2017
    
  • Python
    from sympy import bernoulli as B
    def a(n): return int(2**n*2**(n + 1)*(B(n + 1, 3/4) - B(n + 1, 1/4))/(n + 1))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 24 2017, after PARI code by Michel Marcus
    
  • Python
    from functools import cache
    from math import comb as binomial
    @cache
    def ptan(n):   # see also A331978 and A350972.
        return (0 if n % 2 == 1 else
        -sum(binomial(n,k) * ptan(n-k) if k > 0 else 1 for k in range(0, n-1, 2)))
    def A122045(n): return 1 if n == 0 else ptan(n)
    print([A122045(n) for n in range(31)])  # Peter Luschny, Jun 06 2022
    
  • Sage
    [euler_number(i) for i in range(31)] # Zerinvary Lajos, Mar 15 2009
    

Formula

E.g.f.: sech(x). - Michael Somos, Mar 11 2014
a(n) = (Sum_{k>=0} (-1)^k*(2*k+1)^n)*2. - Gottfried Helms, Mar 09 2012
From Sergei N. Gladkovskii, Oct 14 2012 - Oct 13 2013: (Start)
Continued fractions:
G.f.: 1/U(0) where U(k) = 1 - x + x*(k+1)/(1 - x*(k+1)/U(k+1)).
G.f.: 1/U(0) where U(k) = 1 - x^2 + x^2*(2*k+1)*(2*k+2)/(1 + x^2*(2*k+1)*(2*k+2)/ U(k+1)).
E.g.f.: (1-x)/U(0) where U(k) = 1 - x/(1 - x/(x - (2*k+1)*(2*k+2)/U(k+1))).
E.g.f.: 1 - x^2/U(0) where U(k) = (2*k+1)*(2*k+2) + x^2 - x^2*(2*k+1)*(2*k+2)/U(k+1).
E.g.f.: 1/U(0) where U(k) = 1 + x^2/(2*(2*k+1)*(4*k+1) - 2*x^2*(2*k+1)*(4*k+1)/(x^2 + 4*(4*k+3)*(k+1)/U(k+1))).
E.g.f.: (2 + x^4/(U(0)*(x^2-2) - 2))/(2-x^2) where U(k) = 4*k + 4 + 1/(1 + x^2/(2 - x^2 + (2*k+3)*(2*k+4)/U(k+1))).
G.f.: 1/G(0) where G(k) = 1 + x^2*(2*k+1)^2/(1 + x^2*(2*k+2)^2/G(k+1)) (due to T. J. Stieltjes).
G.f.: 1/S(0) where S(k) = 1 + x^2*(k+1)^2/S(k+1) (due to T. J. Stieltjes).
G.f.: 1 - x/(1+x) + x/(1+x)/Q(0) where Q(k) = 1 - x + x*(k+2)/(1 - x*(k+1)/Q(k+1)).
G.f.: -(1/x)/Q(0) where Q(k) = -1/x + (k+1)^2/Q(k+1) (due to T. J. Stieltjes).
G.f.: (1/(1-x))/Q(0) + 1/(1-x) where Q(k) = 1 - 1/x + (k+1)*(k+2)/Q(k+1).
G.f.: (x/(x-1))/Q(0) + 1/(1-x) where Q(k) = 1 - x + x^2*(k+1)*(k+2)/Q(k+1).
G.f.: 1 - x/(1+x) + (x/(1+x))/Q(0) where Q(k) = 1 + x + (k+1)*(k+2)*x^2/Q(k+1).
E.g.f.: 1 - T(0)*x^2/(2+x^2) where T(k) = 1 - x^2*(2*k+1)*(2*k+2)/(x^2*(2*k+1)*(2*k+2) - ((2*k+1)*(2*k+2) + x^2)*((2*k+3)*(2*k+4) + x^2)/T(k+1)).
G.f.: T(0) where T(k) = 1 - x^2*(k+1)^2/(x^2*(k+1)^2 + 1/T(k+1)). (End)
a(n) = 2^(2*n+1)*(zeta(-n,1/4) - zeta(-n,3/4)), where zeta(a, z) is the generalized Riemann zeta function. - Peter Luschny, Mar 11 2015
a(n) = 2^n*(2^(n+1)/(n+1))*(B(n+1, 3/4) - B(n+1, 1/4)) where B(n,x) is the n-th Bernoulli polynomial. See Liu link. - Michel Marcus, May 20 2017 [This is the same as: a(n) = -4^(n+1)*B(n+1, 1/4)*((n+1) mod 2)/(n+1). Peter Luschny, Oct 30 2020]
a(n) = 2*Im(PolyLog(-n, I)). - Peter Luschny, Sep 29 2020
a(4n) == 5 (mod 60) and a(4n+2) == -1 (mod 60). See Hirschhorn. - Michel Marcus, Jan 11 2022
For n > 1, a(n) = -Sum_{k=1..floor(n/2)} a(n-2*k)*binomial(n,2*k). - Tani Akinari, Sep 15 2023

Extensions

Edited by N. J. A. Sloane, Sep 17 2006

A265285 Carmichael numbers (A002997) k such that k-1 is a square.

Original entry on oeis.org

46657, 2433601, 67371265, 351596817937, 422240040001, 18677955240001, 458631349862401, 286245437364810001, 20717489165917230086401
Offset: 1

Views

Author

Altug Alkan, Dec 06 2015

Keywords

Comments

This sequence contains all Carmichael numbers n such that for all primes p dividing n, p-1 divides n-1 and furthermore, n-1 is a square.
Numbers sqrt(a(n)-1) form a subsequence of A135590. - Max Alekseyev, Apr 25 2024

Examples

			46657 is a term because 46657 - 1 = 46656 = 216^2.
2433601 is a term because 2433601 - 1 = 2433600 = 1560^2.
		

Crossrefs

Subsequence of A265237 and of A265328.

Programs

  • Maple
    isA002997:= proc(n) local F,p;
             if n::even or isprime(n)  then return false fi;
             F:= ifactors(n)[2];
             if max(seq(f[2],f=F)) > 1 then return false fi;
             andmap(f -> (n-1) mod (f[1]-1) = 0,  F)
    end proc:
    select(isA002997, [seq(4*i^2+1,i=1..10^6)]); # Robert Israel, Dec 08 2015
  • PARI
    is_c(n) = { my(f); bittest(n, 0) && !for(i=1, #f=factor(n)~, (f[2, i]==1 && n%(f[1, i]-1)==1)||return) && #f>1 }
    for(n=1, 1e10, if(is_c(n) && issquare(n-1), print1(n, ", ")))
    
  • PARI
    lista(kmax) = {my(m); for(k = 2, kmax, m = k^2 + 1; if(!isprime(m), f = factor(k); for(i = 1, #f~, f[i, 2] *= 2); fordiv(f, d, if(!(m % (d+1)) && isprime(d+1), m /= (d+1))); if(m == 1, print1(k^2 + 1, ", ")))); } \\ Amiram Eldar, May 02 2024

Extensions

a(4)-a(5), using A002997 b-file, from Michel Marcus, Dec 07 2015
a(6) and a(7) from Robert Israel, Dec 08 2015
a(8) from Max Alekseyev, Apr 30 2018
a(9) from Daniel Suteu confirmed by Max Alekseyev, Apr 25 2024

A267462 Carmichael numbers that are not of the form x^2 + y^2 + z^2 where x, y and z are integers.

Original entry on oeis.org

8911, 1152271, 10267951, 14913991, 64377991, 67902031, 139952671, 178482151, 612816751, 652969351, 743404663, 2000436751, 2560600351, 3102234751, 3215031751, 5615659951, 5883081751, 7773873751, 8863329511, 9462932431, 10501586767, 11335174831, 12191597551, 13946829751, 16157879263, 21046047751
Offset: 1

Views

Author

Altug Alkan, Jan 15 2016

Keywords

Comments

Intersection of A002997 and A004215.
Carmichael numbers that are the sum of 4 but no fewer nonzero squares.
Carmichael numbers of the form 8*k + 7.
Subsequence of A185321.
Carmichael numbers of the form x^2 + y^2 + z^2 where x, y and z are integers are 561, 1105, 1729, 2465, 2821, 6601, 10585, 15841, 29341, 41041, 46657, 52633, 62745, 63973, 75361, 101101, 115921, 126217, 162401, 172081, 188461, 252601, 278545, 294409, 314821, 334153, 340561, 399001, 410041, 449065, 488881, 512461, 530881, 552721, ...

Examples

			Carmichael number 561 is not a term of this sequence because 561 = 2^2 + 14^2 + 19^2.
Carmichael number 8911 is a term because there is no integer values of x, y and z for the equation 8911 = x^2 + y^2 + z^2.
Carmichael number 10585 is not a term because 10585 = 0^2 + 37^2 + 96^2.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n)
      local q;
      if isprime(n) then return false fi;
      if 2 &^ (n-1) mod n <> 1 then return false fi;
      for q in ifactors(n)[2] do
        if q[2] > 1 or (n-1) mod (q[1]-1) <> 0 then return false fi
        od;
        true
    end proc:
    select(filter, [seq(8*k+7, k=0..10^7)]); # Robert Israel, Jan 18 2016
  • Mathematica
    Select[8*Range[1,8000000]+7, CompositeQ[#] && Divisible[#-1, CarmichaelLambda[#]] &] (* Amiram Eldar, Jun 26 2019 *)
  • PARI
    isA004215(n) = { my(fouri, j) ; fouri=1 ; while( n >=7*fouri, if( n % fouri ==0, j= n/fouri -7 ; if( j % 8 ==0, return(1) ) ; ) ; fouri *= 4 ; ) ; return(0) ; } { for(n=1, 400, if(isA004215(n), print1(n, ", ") ; ) ; ) ; }
    isA002997(n) = { my(f); bittest(n, 0) && !for(i=1, #f=factor(n)~, (f[2, i]==1 && n%(f[1, i]-1)==1)||return) && #f>1 }
    for(n=0, 1e10, if(isA002997(n) && isA004215(n), print1(n, ", ")));
    
  • PARI
    isA002997(n) = { my(f); bittest(n, 0) && !for(i=1, #f=factor(n)~, (f[2, i]==1 && n%(f[1, i]-1)==1)||return) && #f>1 }
    for(n=0, 1e10, if(isA002997(k=8*n+7), print1(k, ", ")));
Showing 1-3 of 3 results.