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.

Previous Showing 21-30 of 79 results. Next

A001040 a(n+1) = n*a(n) + a(n-1) with a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 1, 3, 10, 43, 225, 1393, 9976, 81201, 740785, 7489051, 83120346, 1004933203, 13147251985, 185066460993, 2789144166880, 44811373131073, 764582487395121, 13807296146243251, 263103209266016890, 5275871481466581051, 111056404320064218961, 2448516766522879398193
Offset: 0

Views

Author

Keywords

Comments

If the initial 0 and 1 are omitted, CONTINUANT transform of 1, 2, 3, 4, 5, ...
a(n+1) is the numerator of the continued fraction given by C(n) = [n, n-1,...,3,2,1], e.g., [1] = 1, [2,1]=3, [3,2,1] = 10/3, [4,3,2,1] = 43/10 etc. Cf. A001053. - Amarnath Murthy, May 02 2001
Along those lines, a(n) is the denominator of the continued fraction [n,n-1,...3,2,1] and is the numerator of the continued fraction [1,2,3,...,n-1]. - Greg Dresden, Feb 20 2020
Starting (1, 3, 10, 43, ...) = eigensequence of triangle A127701. - Gary W. Adamson, Dec 29 2008
For n >=2, a(n) equals the permanent of the (n-1) X (n-1) tridiagonal matrix with 1's along the superdiagonal and the subdiagonal, and consecutive integers from 1 to n along the main diagonal (see Mathematica program below). - John M. Campbell, Jul 08 2011
Generally, solution of the recurrence a(n+1) = n*a(n) + a(n-1) is a(n) = BesselI(n,-2)*(2*a(0)*BesselK(1,2)-2*a(1)*BesselK(0,2)) + (2*a(0)*BesselI(1,2)+2*a(1)*BesselI(0,2))*BesselK(n,2), and asymptotic is a(n) ~ (a(0)*BesselI(1,2)+a(1)*BesselI(0,2)) * (n-1)!. - Vaclav Kotesovec, Jan 05 2013
For n > 0: a(n) = A058294(n,n) = A102473(n,n) = A102472(n,1). - Reinhard Zumkeller, Sep 14 2014
Conjecture: 2*n!*a(n) is the number of open tours by a rook on an (n X 2) chessboard which ends at the opposite line of length n. - Mikhail Kurkov, Nov 19 2019

Examples

			G.f. = x + x^2 + 3*x^3 + 10*x^4 + 43*x^5 + 225*x^6 + 1393*x^7 + 9976*x^8 + ...
		

References

  • Archimedeans Problems Drive, Eureka, 22 (1959), 15.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A column of A058294. Cf. A001053.
Cf. A127701. - Gary W. Adamson, Dec 29 2008
Similar recurrences: A001053, A058279, A058307. - Wolfdieter Lang, May 19 2010

Programs

  • Haskell
    a001040 n = a001040_list !! n
    a001040_list = 0 : 1 : zipWith (+)
       a001040_list (zipWith (*) [1..] $ tail a001040_list)
    -- Reinhard Zumkeller, Mar 05 2013
    
  • Magma
    a:=[1,1]; [0] cat [n le 2 select a[n] else (n-1)*Self(n-1) + Self(n-2): n in [1..23]]; // Marius A. Burtea, Nov 19 2019
  • Maple
    A001040 := proc(n)
        if n <= 1 then
            n;
        else
            (n-1)*procname(n-1)+procname(n-2) ;
        end if;
    end proc: # R. J. Mathar, Mar 13 2015
  • Mathematica
    Table[Permanent[Array[KroneckerDelta[#1, #2]*(#1) + KroneckerDelta[#1, #2 - 1] + KroneckerDelta[#1, #2 + 1] &, {n - 1, n - 1}]], {n, 2, 30}] (* John M. Campbell, Jul 08 2011 *)
    Join[{0},RecurrenceTable[{a[0]==1,a[1]==1,a[n]==n a[n-1]+a[n-2]}, a[n], {n,30}]] (* Harvey P. Dale, Aug 14 2011 *)
    FullSimplify[Table[2(-BesselI[n,-2]BesselK[0,2]+BesselI[0,2]BesselK[n,2]),{n,0,20}]] (* Vaclav Kotesovec, Jan 05 2013 *)
  • PARI
    {a(n) = contfracpnqn( vector(abs(n), i, i))[1, 2]}; /* Michael Somos, Sep 25 2005 */
    
  • Sage
    def A001040(n):
        if n < 2: return n
        return factorial(n-1)*hypergeometric([1-n/2,-n/2+1/2], [1,1-n,1-n], 4)
    [round(A001040(n).n(100)) for n in (0..23)] # Peter Luschny, Sep 10 2014
    

Formula

Generalized Fibonacci sequence for (unsigned) Laguerre triangle A021009. a(n+1) = sum{k=0..floor(n/2), C(n-k, k)(n-k)!/k!}. - Paul Barry, May 10 2004
a(-n) = a(n) for all n in Z. - Michael Somos, Sep 25 2005
E.g.f.: -I*Pi*(BesselY(1, 2*I)*BesselI(0, 2*sqrt(1-x)) - I*BesselI(1, 2)*BesselY(0, 2*I*sqrt(1-x))). Such e.g.f. computations were the result of an e-mail exchange with Gary Detlefs. After differentiation and putting x=0 one has to use simplifications. See the Abramowitz-Stegun handbook, p. 360, 9.1.16 and p. 375, 9.63. - Wolfdieter Lang, May 19 2010
Limit_{n->infinity} a(n)/(n-1)! = BesselI(0,2) = 2.279585302336... (see A070910). - Vaclav Kotesovec, Jan 05 2013
a(n) = 2*(BesselI(0,2)*BesselK(n,2) - BesselI(n,-2)*BesselK(0,2)). - Vaclav Kotesovec, Jan 05 2013
a(n) = (n-1)!*hypergeometric([1-n/2,1/2-n/2],[1,1-n,1-n], 4) for n >= 2. - Peter Luschny, Sep 10 2014
0 = a(n)*(-a(n+2)) + a(n+1)*(+a(n+1) + a(n+2) - a(n+3)) + a(n+2)*(+a(n+2)) for all n in Z. - Michael Somos, Sep 13 2014
Observed: a(n) = A070910*(n-1)!*(1 + 1/(n-1) + 1/(2*(n-1)^2) + O((n-1)^-3)). - A.H.M. Smeets, Aug 19 2018
a(n) mod 2 = A166486(n). - Alois P. Heinz, Jul 03 2023

Extensions

Definition clarified by A.H.M. Smeets, Aug 19 2018

A003401 Numbers of edges of regular polygons constructible with ruler (or, more precisely, an unmarked straightedge) and compass.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 17, 20, 24, 30, 32, 34, 40, 48, 51, 60, 64, 68, 80, 85, 96, 102, 120, 128, 136, 160, 170, 192, 204, 240, 255, 256, 257, 272, 320, 340, 384, 408, 480, 510, 512, 514, 544, 640, 680, 768, 771, 816, 960, 1020, 1024, 1028, 1088, 1280, 1285
Offset: 1

Views

Author

Keywords

Comments

The terms 1 and 2 correspond to degenerate polygons.
These are also the numbers for which phi(n) is a power of 2: A209229(A000010(a(n))) = 1. - Olivier Gérard Feb 15 1999
From Stanislav Sykora, May 02 2016: (Start)
The sequence can be also defined as follows: (i) 1 is a member. (ii) Double of any member is also a member. (iii) If a member is not divisible by a Fermat prime F_k then its product with F_k is also a member. In particular, the powers of 2 (A000079) are a subset and so are the Fermat primes (A019434), which are the only odd prime members.
The definition is too restrictive (though correct): The Georg Mohr - Lorenzo Mascheroni theorem shows that constructibility using a straightedge and a compass is equivalent to using compass only. Moreover, Jean Victor Poncelet has shown that it is also equivalent to using straightedge and a fixed ('rusty') compass. With the work of Jakob Steiner, this became part of the Poncelet-Steiner theorem establishing the equivalence to using straightedge and a fixed circle (with a known center). A further extension by Francesco Severi replaced the availability of a circle with that of a fixed arc, no matter how small (but still with a known center).
Constructibility implies that when m is a member of this sequence, the edge length 2*sin(Pi/m) of an m-gon with circumradius 1 can be written as a finite expression involving only integer numbers, the four basic arithmetic operations, and the square root. (End)
If x,y are terms, and gcd(x,y) is a power of 2 then x*y is also a term. - David James Sycamore, Aug 24 2024

Examples

			34 is a term of this sequence because a circle can be divided into exactly 34 parts. 7 is not.
		

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 183.
  • Allan Clark, Elements of Abstract Algebra, Chapter 4, Galois Theory, Dover Publications, NY 1984, page 124.
  • Duane W. DeTemple, "Carlyle circles and the Lemoine simplicity of polygon constructions." The American Mathematical Monthly 98.2 (1991): 97-108. - N. J. A. Sloane, Aug 05 2021
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • B. L. van der Waerden, Modern Algebra. Unger, NY, 2nd ed., Vols. 1-2, 1953, Vol. 1, p. 187.

Crossrefs

Subsequence of A295298. - Antti Karttunen, Nov 27 2017
A004729 and A051916 are subsequences. - Reinhard Zumkeller, Mar 20 2010
Cf. A000079, A004169, A000215, A099884, A019434 (Fermat primes).
Edge lengths of other constructible m-gons: A002194 (m=3), A002193 (4), A182007 (5), A101464 (8), A094214 (10), A101263 (12), A272534 (15), A272535 (16), A228787 (17), A272536 (20).
Positions of zeros in A293516 (apart from two initial -1's), and in A336469, positions of ones in A295660 and in A336477 (characteristic function).
Cf. also A046528.

Programs

  • Haskell
    a003401 n = a003401_list !! (n-1)
    a003401_list = map (+ 1) $ elemIndices 1 $ map a209229 a000010_list
    -- Reinhard Zumkeller, Jul 31 2012
    
  • Mathematica
    Select[ Range[ 1300 ], IntegerQ[ Log[ 2, EulerPhi[ # ] ] ]& ] (* Olivier Gérard Feb 15 1999 *)
    (* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) Take[ Union[ Flatten[ NestList[2# &, Times @@@ Table[ UnrankSubset[n, Join[{1}, Table[2^2^i + 1, {i, 0, 4}]]], {n, 63}], 11]]], 60] (* Robert G. Wilson v, Jun 11 2005 *)
    nn=10; logs=Log[2,{2,3,5,17,257,65537}]; lim2=Floor[nn/logs[[1]]]; Sort[Reap[Do[z={i,j,k,l,m,n}.logs; If[z<=nn, Sow[2^z]], {i,0,lim2}, {j,0,1}, {k,0,1}, {l,0,1}, {m,0,1}, {n,0,1}]][[2,1]]]
    A092506 = {2, 3, 5, 17, 257, 65537}; s = Sort[Times @@@ Subsets@ A092506]; mx = 1300; Union@ Flatten@ Table[(2^n)*s[[i]], {i, 64}, {n, 0, Log2[mx/s[[i]]]}] (* Robert G. Wilson v, Jul 28 2014 *)
  • PARI
    for(n=1,10^4,my(t=eulerphi(n));if(t/2^valuation(t,2)==1,print1(n,", "))); \\ Joerg Arndt, Jul 29 2014
    
  • PARI
    is(n)=n>>=valuation(n,2); if(n<7, return(n>0)); my(k=logint(logint(n,2),2)); if(k>32, my(p=2^2^k+1); if(n%p, return(0)); n/=p; unknown=1; if(n%p==0, return(0)); p=0; if(is(n)==0, 0, "unknown [has large Fermat number in factorization]"), 4294967295%n==0) \\ Charles R Greathouse IV, Jan 09 2022
    
  • PARI
    is(n)=n>>=valuation(n,2); 4294967295%n==0 \\ valid for n <= 2^2^33, conjecturally valid for all n; Charles R Greathouse IV, Jan 09 2022
    
  • Python
    from sympy import totient
    A003401_list = [n for n in range(1,10**4) if format(totient(n),'b').count('1') == 1]
    # Chai Wah Wu, Jan 12 2015

Formula

Terms from 3 onward are computable as numbers such that cototient-of-totient equals the totient-of-totient: Flatten[Position[Table[co[eu[n]]-eu[eu[n]], {n, 1, 10000}], 0]] eu[m]=EulerPhi[m], co[m]=m-eu[m]. - Labos Elemer, Oct 19 2001, clarified by Antti Karttunen, Nov 27 2017
Any product of 2^k and distinct Fermat primes (primes of the form 2^(2^m)+1). - Sergio Pimentel, Apr 30 2004, edited by Franklin T. Adams-Watters, Jun 16 2006
If the well-known conjecture that there are only five prime Fermat numbers F_k=2^{2^k}+1, k=0,1,2,3,4 is true, then we have exactly: Sum_{n>=1} 1/a(n)= 2*Product_{k=0..4} (1+1/F_k) = 4869735552/1431655765 = 3.40147098978.... - Vladimir Shevelev and T. D. Noe, Dec 01 2010
log a(n) >> sqrt(n); if there are finitely many Fermat primes, then log a(n) ~ k log n for some k. - Charles R Greathouse IV, Oct 23 2015

Extensions

Definition clarified by Bill Gosper. - N. J. A. Sloane, Jun 14 2020

A001053 a(n+1) = n*a(n) + a(n-1) with a(0)=1, a(1)=0.

Original entry on oeis.org

1, 0, 1, 2, 7, 30, 157, 972, 6961, 56660, 516901, 5225670, 57999271, 701216922, 9173819257, 129134686520, 1946194117057, 31268240559432, 533506283627401, 9634381345852650, 183586751854827751, 3681369418442407670, 77492344539145388821, 1708512949279640961732
Offset: 0

Views

Author

Keywords

Comments

Denominator of continued fraction given by C(n) = [ 1; 2,3,4,...n ]. Cf. A001040. - Amarnath Murthy, May 02 2001
If initial 1 is omitted, CONTINUANT transform of 0, 1, 2, 3, 4, 5, ...
Number of deco polyominoes of height n having no 1-cell columns. A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column. Example: a(2)=1 because the vertical and horizontal dominoes are the deco polyominoes of height 2, of which only the vertical domino does not have 1-cell columns. a(n)=A121554(n,0). - Emeric Deutsch, Aug 16 2006
For positive n, a(n) equals the permanent of the n X n tridiagonal matrix with 1's along the superdiagonal and the subdiagonal, and consecutive integers from 0 to n-1 along the main diagonal (see Mathematica code below). - John M. Campbell, Jul 08 2011
Conjecture: 2*n!*a(n) is the number of open tours by a rook on an (n X 2) chessboard which starts and ends at the same line of length n. - Mikhail Kurkov, Nov 19 2019

Examples

			G.f. = 1 + x^2 + 2*x^3 + 7*x^4 + 30*x^5 + 157*x^6 + 972*x^7 + 6961*x^8 + ...
a(5) = 4*a(4) + a(3) = 4*7+2 = 30.
See A058279 and A058307 for similar recurrences and e.g.f.s. - _Wolfdieter Lang_, May 19 2010
		

References

  • Archimedeans Problems Drive, Eureka, 20 (1957), 15.
  • M. E. Larsen, Summa Summarum, A. K. Peters, Wellesley, MA, 2007; see p. 35. [From N. J. A. Sloane, Jan 29 2009]
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A column of A058294.
The square roots of the terms of A144656.
See also the constant in A060997.

Programs

  • GAP
    a:=[0,1];; for n in [3..25] do a[n]:=(n-1)*a[n-1]+a[n-2]; od; Concatenation([1], a); # G. C. Greubel, Sep 20 2019
  • Haskell
    a001053 n = a001053_list !! n
    a001053_list = 1 : 0 :
       zipWith (+) a001053_list (zipWith (*) [1..] $ tail a001053_list)
    -- Reinhard Zumkeller, Nov 02 2011
    
  • Magma
    I:=[0,1]; [1] cat [n le 2 select I[n] else (n-1)*Self(n-1) + Self(n-2): n in [1..25]]; // G. C. Greubel, Sep 20 2019
    
  • Maple
    a[0]:=1: a[1]:=0: for n from 2 to 23 do a[n]:=(n-1)*a[n-1]+a[n-2] od: seq(a[n],n=0..23); # Emeric Deutsch, Aug 16 2006
  • Mathematica
    a[0]=1; a[1] =0; a[n_]:= (n-1)*a[n-1] + a[n-2]; Table[a[n], {n, 0, 21}] (* Robert G. Wilson v, Feb 24 2005 *)
    a[0] = 1; a[1] = 0; a[n_] := Permanent[SparseArray[{{i_, i_} :> i-1, Band[{2, 1}] -> 1, Band[{1, 2}] -> 1}, {n, n}]]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 20}] (* John M. Campbell, Jul 08 2011, updated by Jean-François Alcover, Nov 14 2016 *)
    RecurrenceTable[{a[0]==1,a[1]==0,a[n]==(n-1)a[n-1]+a[n-2]},a,{n,30}] (* Harvey P. Dale, Jan 31 2013 *)
    a[ n_] := With[ {m = Abs@n}, If[ m < 2, Boole[m == 0],
    Gamma[m] HypergeometricPFQ[{3/2 - m/2, 1 - m/2}, {2, 2 - m, 1 - m}, 4]]]; (* Michael Somos, Nov 30 2018 *)
  • PARI
    {a(n) = contfracpnqn(vector(abs(n), i, i))[2, 2]}; /* Michael Somos, Sep 25 2005 */
    
  • Sage
    def A001053(n):
        if n < 3: return 1 if n != 1 else 0
        return gamma(n)*hypergeometric([3/2-n/2,1-n/2], [2,2-n,1-n], 4)
    [round(A001053(n).n(100)) for n in (0..23)] # Peter Luschny, Sep 11 2014
    

Formula

a(n) = a(-n). for all n in Z. - Michael Somos, Sep 25 2005
E.g.f.: -Pi*(BesselI(1,2)*BesselY(0, 2*I*sqrt(1-x)) + I*BesselY(1, 2*I)*BesselI(0, 2*sqrt(1-x))). Such e.g.f. computations were the result of an e-mail exchange with Gary Detlefs. After differentiation and putting x=0 one has to use simplifications. See the Abramowitz-Stegun handbook, p. 360, 9.1.16 and p. 375, 9.63. - Wolfdieter Lang, May 19 2010
a(n) = 2*K_1(2)*I_n(-2)+2*I_1(2)*K_n(2), where In(z) is the modified Bessel function of the first kind and Kn(x) is the modified Bessel function of the second kind. - Alexander R. Povolotsky, Jan 26 2011
Limit_{n->infinity} a(n)/(n-1)! = BesselI(1,2) = 1.590636854637329... (A096789). - Vaclav Kotesovec, Jan 05 2013, corrected Mar 02 2013
a(n+1) = Sum_{k = 0..floor((n-1)/2)} (n-2*k-1)!*binomial(n-k-1,k) * binomial(n-k,k+1). Cf. A058798. - Peter Bala, Aug 01 2013
a(n) = Gamma(n)*hypergeometric([3/2-n/2, 1-n/2], [2, 2-n, 1-n], 4) for n >= 3. - Peter Luschny, Sep 11 2014
0 = a(n)*(-a(n+2)) + a(n+1)*(a(n+1) + a(n+2) - a(n+3)) + a(n+2)*(a(n+2)) for all n in Z. - Michael Somos, Feb 09 2017
Observed: a(n) = A096789*(n-1)!*(1 + 1/(n-1) + 1/(2*(n-1)^2) + O((n-1)^-3)). - A.H.M. Smeets, Aug 19 2018

Extensions

More terms from James Sellers, Sep 19 2000

A005180 Orders of simple groups.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 60, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 168, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241
Offset: 1

Views

Author

Keywords

Comments

Officially the group of order 1 is not considered to be simple - see for example Rotman, Group Theory.

References

  • J. H. Conway, R. T. Curtis, S. P. Norton, R. A. Parker and R. A. Wilson, ATLAS of Finite Groups. Oxford Univ. Press, 1985 [for best online version see https://oeis.org/wiki/Welcome#Links_to_Other_Sites].
  • M. Hall, Jr., A search for simple groups of order less than one million, pp. 137-168 of J. Leech, editor, Computational Problems in Abstract Algebra. Pergamon, Oxford, 1970.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000001, A001228. Union of {1}, A000040 and A001034.

Programs

  • Mathematica
    (* Recomputation from A001034. *)
    maxOrder = 7789;
    A001034 = Select[Cases[Import["https://oeis.org/A001034/b001034.txt", "Table"], {, }][[All, 2]], # <= maxOrder&];
    Union[{1}, Prime[Range[PrimePi[maxOrder]]], A001034] (* Jean-François Alcover, Aug 19 2019 *)

A007491 Smallest prime > n^2.

Original entry on oeis.org

2, 5, 11, 17, 29, 37, 53, 67, 83, 101, 127, 149, 173, 197, 227, 257, 293, 331, 367, 401, 443, 487, 541, 577, 631, 677, 733, 787, 853, 907, 967, 1031, 1091, 1163, 1229, 1297, 1373, 1447, 1523, 1601, 1693, 1777, 1861, 1949, 2027, 2129, 2213, 2309, 2411, 2503
Offset: 1

Views

Author

Keywords

Comments

Suggested by Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2.
Legendre's conjecture is equivalent to a(n) < (n+1)^2. - Jean-Christophe Hervé, Oct 26 2013
From Jaroslav Krizek, Apr 02 2016: (Start)
Conjectures:
1) There is always a prime p between n^2 and n^2+n (verified up to 13*10^6).
2) a(n) is the smallest prime p such that n^2 < p < n^2+n; a(n) < n^2+n.
3) For all numbers k >= 1 there is the smallest number m > 2*(k+1) such that for all numbers n >= m there is always a prime p between n^2 and n^2 + n - 2k. Sequence of numbers m for k >= 1: 6, 8, 12, 13, 14, 24, 24, 24, 30, 30, 30, 31, 33, 35, 43, ...; lim_{k->oo} m/2k = 1. Example: k=2; for all numbers n >= 8 there is always a prime p between n^2 and n^2 + n - 4. (End)

References

  • Archimedeans Problems Drive, Eureka, 24 (1961), 20.
  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 19.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007491 = a007918 . a000290  -- Reinhard Zumkeller, Jun 07 2015
    
  • Magma
    [NextPrime(n^2): n in [1..50]]; // Vincenzo Librandi, Apr 30 2015
    
  • Maple
    [seq(nextprime(i^2), i=1..100)];
  • Mathematica
    NextPrime[Range[60]^2]  (* Harvey P. Dale, Mar 24 2011 *)
  • PARI
    vector(100,i,nextprime(i^2))
    
  • Python
    from sympy import nextprime
    def a(n): return nextprime(n**2)
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Jan 13 2023

Formula

a(n) = A007918(A000290(n)). - Reinhard Zumkeller, Jun 07 2015

Extensions

More terms from Labos Elemer, Nov 17 2000
Definition modified by Jean-Christophe Hervé, Oct 26 2013

A005703 Number of n-node connected graphs with at most one cycle.

Original entry on oeis.org

1, 1, 1, 2, 4, 8, 19, 44, 112, 287, 763, 2041, 5577, 15300, 42419, 118122, 330785, 929469, 2621272, 7411706, 21010378, 59682057, 169859257, 484234165, 1382567947, 3952860475, 11315775161, 32430737380, 93044797486, 267211342954, 768096496093, 2209772802169
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of pseudotrees on n nodes. - Eric W. Weisstein, Jun 11 2012
Also unlabeled connected graphs covering n vertices with at most n edges. For this definition we have a(1) = 0 and possibly a(0) = 0. - Gus Wiseman, Feb 20 2024

Examples

			From _Gus Wiseman_, Feb 20 2024: (Start)
Representatives of the a(0) = 1 through a(5) = 8 graphs:
  {}  .  {12}  {12,13}     {12,13,14}     {12,13,14,15}
               {12,13,23}  {12,13,24}     {12,13,14,25}
                           {12,13,14,23}  {12,13,24,35}
                           {12,13,24,34}  {12,13,14,15,23}
                                          {12,13,14,23,25}
                                          {12,13,14,23,45}
                                          {12,13,14,25,35}
                                          {12,13,24,35,45}
(End)
		

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 150.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000055, A000081, A001429 (labeled A057500), A134964 (number of pseudoforests, labeled A133686).
The labeled version is A129271.
The connected complement is A140636, labeled A140638.
Non-connected: A368834 (labeled A367869) or A370316 (labeled A369191).
A001187 counts connected graphs, unlabeled A001349.
A006125 counts simple graphs, unlabeled A000088.
A006129 counts covering graphs, unlabeled A002494.
A062734 counts connected graphs by number of edges.

Programs

  • Mathematica
    Needs["Combinatorica`"]; nn = 20; t[x_] := Sum[a[n] x^n, {n, 1, nn}];
    a[0] = 0;
    b = Drop[Flatten[
        sol = SolveAlways[
          0 == Series[
            t[x] - x Product[1/(1 - x^i)^a[i], {i, 1, nn}], {x, 0, nn}],
          x]; Table[a[n], {n, 0, nn}] /. sol], 1];
    r[x_] := Sum[b[[n]] x^n, {n, 1, nn}]; c =
    Drop[Table[
        CoefficientList[
         Series[CycleIndex[DihedralGroup[n], s] /.
           Table[s[i] -> r[x^i], {i, 1, n}], {x, 0, nn}], x], {n, 3,
         nn}] // Total, 1];
    d[x_] := Sum[c[[n]] x^n, {n, 1, nn}]; CoefficientList[
    Series[r[x] - (r[x]^2 - r[x^2])/2 + d[x] + 1, {x, 0, nn}], x] (* Geoffrey Critzer, Nov 17 2014 *)
  • PARI
    \\ TreeGf gives gf of A000081.
    TreeGf(N)={my(A=vector(N, j, 1)); for (n=1, N-1, A[n+1] = 1/n * sum(k=1, n, sumdiv(k, d, d*A[d]) * A[n-k+1] ) ); x*Ser(A)}
    seq(n)={my(t=TreeGf(n)); my(g(e)=subst(t + O(x*x^(n\e)), x, x^e) + O(x*x^n)); Vec(1 + g(1) + (g(2) - g(1)^2)/2 + sum(k=3, n, sumdiv(k, d, eulerphi(d)*g(d)^(k/d))/k + if(k%2, g(1)*g(2)^(k\2), (g(1)^2+g(2))*g(2)^(k/2-1)/2))/2)}; \\ Andrew Howroyd and Washington Bomfim, May 15 2021

Formula

a(n) = A000055(n) + A001429(n).

Extensions

More terms from Vladeta Jovovic, Apr 19 2000 and from Michael Somos, Apr 26 2000
a(27) corrected and a(28) and a(29) computed by Washington Bomfim, May 14 2008

A005347 First differences of A005579.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 5, 8, 13, 20, 34, 53, 88, 143, 236, 387, 641, 1061, 1763, 2937, 4903, 8202, 13750, 23095, 38850, 65461, 110465, 186665, 315827, 535011, 907341, 1540416, 2617782, 4452846, 7581016, 12917486, 22027745, 37591270, 64196610
Offset: 0

Views

Author

N. J. A. Sloane, R. K. Guy, Apr 12 1988

Keywords

Comments

This is example 42 in Guy's paper. a(2)-a(8) are the same as the Fibonacci sequence A000045. Subsequent terms deviate from Fibonacci. - T. D. Noe, May 08 2006

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    prod = Interval[1]; k = k0 = 0; Join[{1, 1}, Table[While[Max[prod] <= n, k++; p = Prime[k]; prod = N[prod*p/(p - 1), 30]]; If[Min[prod] > n, If[k > 2, Print[k - k0] ]; k0 = k; k, "too few digits"], {n, 2, 39}] // Differences] (* Jean-François Alcover, Oct 07 2016, using T. D. Noe's code for A005579 *)

Formula

a(n) = A005579(n+1) - A005579(n) - T. D. Noe, May 08 2006

Extensions

More terms from Harvey P. Dale, Aug 07 2013
Offset changed to 0, a(0) prepended, and a(1) inserted by Amiram Eldar, Apr 18 2025

A046699 a(1) = a(2) = 1, a(n) = a(n - a(n-1)) + a(n-1 - a(n-2)) if n > 2.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 8, 8, 8, 9, 10, 10, 11, 12, 12, 12, 13, 14, 14, 15, 16, 16, 16, 16, 16, 17, 18, 18, 19, 20, 20, 20, 21, 22, 22, 23, 24, 24, 24, 24, 25, 26, 26, 27, 28, 28, 28, 29, 30, 30, 31, 32, 32, 32, 32, 32, 32, 33, 34, 34, 35, 36, 36, 36, 37
Offset: 1

Views

Author

Keywords

Comments

Ignoring first term, this is the meta-Fibonacci sequence for s=0. - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
Except for the first term, n occurs A001511(n) times. - Franklin T. Adams-Watters, Oct 22 2006

References

  • Sequence was proposed by Reg Allenby.
  • B. W. Conolly, "Meta-Fibonacci sequences," in S. Vajda, editor, Fibonacci and Lucas Numbers and the Golden Section. Halstead Press, NY, 1989, pp. 127-138. See Eq. (2).
  • Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society & Société Mathématique du Canada, Problem 5, 1990, pp. 212-213, 1993.
  • S. Vajda, Fibonacci and Lucas Numbers and the Golden Section, Wiley, 1989, see p. 129.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

Programs

  • Haskell
    a046699 n = a046699_list !! (n-1)
    a046699_list = 1 : 1 : zipWith (+) zs (tail zs) where
       zs = map a046699 $ zipWith (-) [2..] a046699_list
    -- Reinhard Zumkeller, Jan 02 2012
    
  • Magma
    [ n le 2 select 1 else Self(n - Self(n-1)) + Self(n-1 -Self(n-2)):n in [1..80]]; // Marius A. Burtea, Oct 17 2019
  • Maple
    a := proc(n) option remember; if n <= 1 then return 1 end if; if n <= 2 then return 2 end if; return add(a(n - i + 1 - a(n - i)), i = 1 .. 2) end proc # Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
    a := proc(n) option remember; if n <= 2 then 1 else a(n - a(n-1)) + a(n-1 - a(n-2)); fi; end; # N. J. A. Sloane, Apr 16 2014
  • Mathematica
    a[n_] := (k = 1; While[ !Divisible[(2*++k)!, 2^(n-1)]]; k); a[1] = a[2] = 1; Table[a[n], {n, 1, 72}] (* Jean-François Alcover, Oct 06 2011, after Benoit Cloitre *)
    CoefficientList[ Series[1 + x/(1 - x)*Product[1 + x^(2^n - 1), {n, 6}], {x, 0, 80}], x] (* or *)
    a[1] = a[2] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - 1 - a[n - 2]]; Array[a, 80] (* Robert G. Wilson v, Sep 08 2014 *)
  • Maxima
    a[1]:1$
    a[2]:1$
    a[n]:=a[n-a[n-1]]+a[n-1-a[n-2]]$
    makelist(a[n],n,2,60); /* Martin Ettl, Oct 29 2012 */
    
  • PARI
    a(n)=if(n<0,1,s=1;while((2*s)!%2^(n-1)>0,s++);s) \\ Benoit Cloitre, Jan 19 2007
    
  • Python
    from sympy import factorial
    def a(n):
        if n<3: return 1
        s=1
        while factorial(2*s)%(2**(n - 1))>0: s+=1
        return s
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 11 2017, after Benoit Cloitre
    

Formula

First differences seem to be A079559. - Vladeta Jovovic, Nov 30 2003. This is correct and not too hard to prove, giving the generating function x + x^2(1+x)(1+x^3)(1+x^7)(1+x^15).../(1-x). - Paul Boddington, Jul 30 2004
G.f.: x + x^2/(1-x) * Product_{n=1}^{infinity} (1 + x^(2^n-1)). - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
For n>=1, a(n)=w(n-1) where w(n) is the least k such that 2^n divides (2k)!. - Benoit Cloitre, Jan 19 2007
Conjecture: a(n+1) = a(n) + A215530(a(n) + n) for all n > 0. - Velin Yanev, Oct 17 2019
From Bernard Schott, Dec 03 2021: (Start)
a(n) <= a(n+1) <= a(n) +1.
For n > 1, if a(n) is odd, then a(n+1) = a(n) + 1.
a(2^n+1) = 2^(n-1) + 1 for n > 0.
Results coming from the 5th problem proposed during the 22nd Canadian Mathematical Olympiad in 1990 (link IMO Compendium and Doob reference). (End)

A027623 a(0) = 1; for n > 0, a(n) = number of rings with n elements.

Original entry on oeis.org

1, 1, 2, 2, 11, 2, 4, 2, 52, 11, 4, 2, 22, 2, 4, 4, 390, 2, 22, 2, 22, 4, 4, 2, 104, 11, 4, 59, 22, 2, 8, 2
Offset: 0

Views

Author

Keywords

Comments

Here a ring means (R,+,*): (R,+) is an abelian group, * is associative, a*(b+c) = a*b + a*c, (a+b)*c = a*c + b*c. Need not contain "1", * need not be commutative.
The sequence continues a(32) = ? (>18590), a(33) = 4, 4, 4, 121, 2, 4, 4, 104, 2, 8, 2, 22, 22, 4, 2, 780, 11, 22, 4, 22, 2, 118, 4, 104, 4, 4, 2, 44, 2, 4, 22 = a(63), a(64) = ? (> 829826). - Christof Noebauer (christof.noebauer(AT)algebra.uni-linz.ac.at), Sep 29 2000
The paper by Antipkin/Elizarov also gives the number a(p^3) of rings of order p^3. - Hans H. Storrer (storrer(AT)math.unizh.ch), Sep 16 2003
If n is a squared prime, there are 11 mutually nonisomorphic rings of order n [see Raghavendran, p. 228]. - R. J. Mathar, Apr 20 2008

Examples

			The 11 rings of order 4 (from _Christian G. Bower_):
  over C4: 1*1 = 0, 1 or 2;
  over C2 X C2 = <1> X <2>: (1*1,1*2,2*1,2*2) = 0000, 0001, 0002, 0012, 0102, 0112, 1002 or 1223.
		

Crossrefs

From Bernard Schott, Mar 28 2021: (Start)
--------------------------------------------------------------------
| Rings with | with 1 | without 1 | with 1 or |
| n elements | | | without 1 |
--------------------------------------------------------------------
| Commutative | A127707 | A342375 | A037289 |
--------------------------------------------------------------------
| Noncommutative | A127708 | A342376 | A209401 |
--------------------------------------------------------------------
| Commutative or | A037291 | A342377 | this sequence: a(0) = 1 |
| noncommutative | | | A037234 with a(0) = 0 |
--------------------------------------------------------------------
(End)

Programs

  • PARI
    apply( A027623(n, e=0)=if( !e, vecprod([call(self(), f) | f <- factor(n)~]), e<3, [2^(n>0), 11][e], e==3, if(n>2, 3*sqrtnint(n, 3), 2)+50, n>2 || e>4, /*error*/("not yet implemented"), 390), [0..63]) \\ M. F. Hasler, Jan 05 2021

Extensions

More terms from Christian G. Bower, Jun 15 1998
a(16) from Christof Noebauer (christof.noebauer(AT)algebra.uni-linz.ac.at), Sep 29 2000

A005186 a(n) is the number of integers m which take n steps to reach 1 in '3x+1' problem.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 10, 14, 18, 24, 29, 36, 44, 58, 72, 91, 113, 143, 179, 227, 287, 366, 460, 578, 732, 926, 1174, 1489, 1879, 2365, 2988, 3780, 4788, 6049, 7628, 9635, 12190, 15409, 19452, 24561, 31025, 39229, 49580, 62680, 79255, 100144
Offset: 0

Views

Author

Keywords

Comments

Appears to settle into approximately exponential growth after about 25 terms or so with a ratio between adjacent terms of roughly 1.264. - Howard A. Landman, May 24 2003
David W. Wilson (Jun 10 2003) gives a heuristic argument that the constant should be the largest eigenvalue of the matrix [ 1 0 0 1 0 0 / 0 0 0 0 1/3 0 / 0 1 0 0 1 0 / 0 0 0 0 1/3 0 / 0 0 1 0 0 1 / 0 0 0 0 1/3 0 ], which is (3 + sqrt(21))/6 = 1.2637626... = A176014.
Merlini and Sala (1999) deduce the value (1 + sqrt(7/3))/2 (A176014) for the asymptotic ratio a(n+1)/a(n) for n -> oo and call this "Collatz's constant". This is the same value as the constant mentioned above, see the "Heuristic argument for the asymptotic value (3 + sqrt(21))/6 of the ratio a(n+1)/a(n)" note in the Links section. - Markus Sigg, Nov 27 2020

References

  • R. K. Guy, personal communication.
  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see p. 33.
  • Danilo Merlini and Nicoletta Sala, On the Fibonacci's Attractor and the Long Orbits in the 3n+1 Problem, International Journal of Chaos Theory and Applications, Vol. 4, No. 2-3 (1999), 75-84.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    (* This program is not suitable to compute more than 20 terms *) maxiSteps = 20; mMaxi = 2*10^6; Clear[a]; a[] = 0; steps[m] := steps[m] = Module[{n = m, ns = 0}, While[n != 1, If[Mod[n, 2] == 0, n = n/2, n = 3*n+1]; ns++]; ns]; Do[sn = steps[m]; If[sn <= maxiSteps, a[sn] = a[sn]+1; Print["m = ", m, " a(", sn, ") = ", a[sn]]], {m, 1, mMaxi}]; Table[a[n], {n, 0, maxiSteps}] (* Jean-François Alcover, Oct 18 2013 *)
    (* 60 terms in under a minute *) s = {1}; t = Join[{1}, Table[s = Union[2*s, (Select[s, Mod[#, 3] == 1 && OddQ[(# - 1)/3] && (# - 1)/3 > 1 &] - 1)/3]; Length[s], {n, 60}]] (* T. D. Noe, Oct 18 2013 *)
  • PARI
    first(n)=my(v=vector(n+1), u=[1], old=u, w); v[1]=1; for(i=1, n, w=List(); for(j=1, #u, listput(w, 2*u[j]); if(u[j]%6==4, listput(w, u[j]\3))); old=setunion(old, u); u=setminus(Set(w), old); v[i+1]=#u); v \\ Charles R Greathouse IV, Jun 26 2017
    
  • PARI
    first(n)={my(v=Vec([1, 1, 1, 1, 1], n+1), u=[16]); for(i=5, n, u=concat(2*u, [x\3 | x<-u, x%6==4 ]); v[i+1]=#u); v} \\ Joe Slater, Sep 01 2024
    
  • Perl
    #!/usr/bin/perl @old = ( 1 ); while (1) { print scalar(@old), " "; @new = ( ); foreach $n (@old) { $used{$n} = 1; if (($n % 6) == 4) { $m = ($n-1)/3; push(@new,$m) unless ($used{$m}); } $m = $n + $n; push(@new,$m) unless ($used{$m}); } @old = @new; }
    
  • Python
    def search(x,d,lst):
        while d>0:
            lst[d]+=1
            if x%6==4 and x>4:
                search(x//3,d-1,lst)
            x*=2
            d-=1
        lst[d]+=1
    def A005186_list(n_max):
        lst=[0]*(n_max+1)
        search(1,n_max,lst)
        return lst[::-1]
    # Bert Dobbelaere, Sep 09 2018

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001
Previous Showing 21-30 of 79 results. Next