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 141 results. Next

A380979 Composites that cause a witness to be added to a set of Fermat witnesses: a(n) is the smallest composite number that is not guaranteed composite using Fermat's Little Theorem by the witness A380978(i) for any i < n.

Original entry on oeis.org

4, 341, 1105, 1729, 29341, 75361, 162401, 252601, 294409, 334153, 399001, 1152271, 1615681, 2508013, 3581761, 3828001, 6189121, 6733693, 10024561, 10267951, 14469841, 17098369, 17236801, 19384289, 23382529, 29111881, 34657141, 53711113, 64377991, 79411201, 79624621
Offset: 1

Views

Author

Jan Kostanjevec, Feb 10 2025

Keywords

Comments

A380978(n) is defined as the minimal Fermat witness that guarantees the compositeness of a(n). See the Weisstein link for details of the guarantee -- the option that uses a property derived from Fermat's little theorem.
To what extent does this differ from A135720 sorted? - Peter Munn, Mar 12 2025

Examples

			a(1) = 4, since 4 is the smallest composite number and we need to add a witness to the empty set to guarantee its compositeness. 2 is the minimal Fermat witness for the compositeness of 4, so the set of witnesses becomes {2}.
a(2) = 341, since 341 is the smallest composite number that requires a witness other than 2, namely 3.
a(3) = 1105, since 1105 is the smallest composite number that requires a witness other than 2 and 3, namely 5.
		

Crossrefs

Cf. A001567, A002997, A006945, A098654, A135720, A380978 (new minimal Fermat witness).

Extensions

More terms from Jinyuan Wang, Mar 05 2025

A003415 a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(m*n) = m*a(n) + n*a(m).

Original entry on oeis.org

0, 0, 1, 1, 4, 1, 5, 1, 12, 6, 7, 1, 16, 1, 9, 8, 32, 1, 21, 1, 24, 10, 13, 1, 44, 10, 15, 27, 32, 1, 31, 1, 80, 14, 19, 12, 60, 1, 21, 16, 68, 1, 41, 1, 48, 39, 25, 1, 112, 14, 45, 20, 56, 1, 81, 16, 92, 22, 31, 1, 92, 1, 33, 51, 192, 18, 61, 1, 72, 26, 59, 1, 156, 1, 39, 55, 80, 18, 71
Offset: 0

Views

Author

Keywords

Comments

Can be extended to negative numbers by defining a(-n) = -a(n).
Based on the product rule for differentiation of functions: for functions f(x) and g(x), (fg)' = f'g + fg'. So with numbers, (ab)' = a'b + ab'. This implies 1' = 0. - Kerry Mitchell, Mar 18 2004
The derivative of a number x with respect to a prime number p as being the number "dx/dp" = (x-x^p)/p, which is an integer due to Fermat's little theorem. - Alexandru Buium, Mar 18 2004
The relation (ab)' = a'b + ab' implies 1' = 0, but it does not imply p' = 1 for p a prime. In fact, any function f defined on the primes can be extended uniquely to a function on the integers satisfying this relation: f(Product_i p_i^e_i) = (Product_i p_i^e_i) * (Sum_i e_i*f(p_i)/p_i). - Franklin T. Adams-Watters, Nov 07 2006
See A131116 and A131117 for record values and where they occur. - Reinhard Zumkeller, Jun 17 2007
Let n be the product of a multiset P of k primes. Consider the k-dimensional box whose edges are the elements of P. Then the (k-1)-dimensional surface of this box is 2*a(n). For example, 2*a(25) = 20, the perimeter of a 5 X 5 square. Similarly, 2*a(18) = 42, the surface area of a 2 X 3 X 3 box. - David W. Wilson, Mar 11 2011
The arithmetic derivative n' was introduced, probably for the first time, by the Spanish mathematician José Mingot Shelly in June 1911 with "Una cuestión de la teoría de los números", work presented at the "Tercer Congreso Nacional para el Progreso de las Ciencias, Granada", cf. link to the abstract on Zentralblatt MATH, and L. E. Dickson, History of the Theory of Numbers. - Giorgio Balzarotti, Oct 19 2013
a(A235991(n)) odd; a(A235992(n)) even. - Reinhard Zumkeller, Mar 11 2014
Sequence A157037 lists numbers with prime arithmetic derivative, i.e., indices of primes in this sequence. - M. F. Hasler, Apr 07 2015
Maybe the simplest "natural extension" of the arithmetic derivative, in the spirit of the above remark by Franklin T. Adams-Watters (2006), is the "pi based" version where f(p) = primepi(p), see sequence A258851. When f is chosen to be the identity map (on primes), one gets A066959. - M. F. Hasler, Jul 13 2015
When n is composite, it appears that a(n) has lower bound 2*sqrt(n), with equality when n is the square of a prime, and a(n) has upper bound (n/2)*log_2(n), with equality when n is a power of 2. - Daniel Forgues, Jun 22 2016
If n = p1*p2*p3*... where p1, p2, p3, ... are all the prime factors of n (not necessarily distinct), and h is a real number (we assume h nonnegative and < 1), the arithmetic derivative of n is equivalent to n' = lim_{h->0} ((p1+h)*(p2+h)*(p3+h)*... - (p1*p2*p3*...))/h. It also follows that the arithmetic derivative of a prime is 1. We could assume h = 1/N, where N is an integer; then the limit becomes {N -> oo}. Note that n = 1 is not a prime and plays the role of constant. - Giorgio Balzarotti, May 01 2023

Examples

			6' = (2*3)' = 2'*3 + 2*3' = 1*3 + 2*1 = 5.
Note that, for example, 2' + 3' = 1 + 1 = 2, (2+3)' = 5' = 1. So ' is not linear.
G.f. = x^2 + x^3 + 4*x^4 + x^5 + 5*x^6 + x^7 + 12*x^8 + 6*x^9 + 7*x^10 + ...
		

References

  • G. Balzarotti, P. P. Lava, La derivata aritmetica, Editore U. Hoepli, Milano, 2013.
  • E. J. Barbeau, Problem, Canad. Math. Congress Notes, 5 (No. 8, April 1973), 6-7.
  • L. E. Dickson, History of the Theory of Numbers, Vol. 1, Chapter XIX, p. 451, Dover Edition, 2005. (Work originally published in 1919.)
  • A. M. Gleason et al., The William Lowell Putnam Mathematical Competition: Problems and Solutions 1938-1964, Math. Assoc. America, 1980, p. 295.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A086134 (least prime factor of n').
Cf. A086131 (greatest prime factor of n').
Cf. A068719 (derivative of 2n).
Cf. A068720 (derivative of n^2).
Cf. A068721 (derivative of n^3).
Cf. A001787 (derivative of 2^n).
Cf. A027471 (derivative of 3^(n-1)).
Cf. A085708 (derivative of 10^n).
Cf. A068327 (derivative of n^n).
Cf. A024451 (derivative of p#).
Cf. A068237 (numerator of derivative of 1/n).
Cf. A068238 (denominator of derivative of 1/n).
Cf. A068328 (derivative of squarefree numbers).
Cf. A068311 (derivative of n!).
Cf. A168386 (derivative of n!!).
Cf. A260619 (derivative of hyperfactorial(n)).
Cf. A260620 (derivative of superfactorial(n)).
Cf. A068312 (derivative of triangular numbers).
Cf. A068329 (derivative of Fibonacci(n)).
Cf. A096371 (derivative of partition number).
Cf. A099301 (derivative of d(n)).
Cf. A099310 (derivative of phi(n)).
Cf. A342925 (derivative of sigma(n)).
Cf. A349905 (derivative of prime shift).
Cf. A327860 (derivative of primorial base exp-function).
Cf. A369252 (derivative of products of three odd primes), A369251 (same sorted).
Cf. A068346 (second derivative of n).
Cf. A099306 (third derivative of n).
Cf. A258644 (fourth derivative of n).
Cf. A258645 (fifth derivative of n).
Cf. A258646 (sixth derivative of n).
Cf. A258647 (seventh derivative of n).
Cf. A258648 (eighth derivative of n).
Cf. A258649 (ninth derivative of n).
Cf. A258650 (tenth derivative of n).
Cf. A185232 (n-th derivative of n).
Cf. A258651 (A(n,k) = k-th arithmetic derivative of n).
Cf. A085731 (gcd(n,n')), A083345 (n'/gcd(n,n')), A057521 (gcd(n, (n')^k) for k>1).
Cf. A342014 (n' mod n), A369049 (n mod n').
Cf. A341998 (A003557(n')), A342001 (n'/A003557(n)).
Cf. A098699 (least x such that x' = n, antiderivative of n).
Cf. A098700 (n such that x' = n has no integer solution).
Cf. A099302 (number of solutions to x' = n).
Cf. A099303 (greatest x such that x' = n).
Cf. A051674 (n such that n' = n).
Cf. A083347 (n such that n' < n).
Cf. A083348 (n such that n' > n).
Cf. A099304 (least k such that (n+k)' = n' + k').
Cf. A099305 (number of solutions to (n+k)' = n' + k').
Cf. A328235 (least k > 0 such that (n+k)' = u * n' for some natural number u).
Cf. A328236 (least m > 1 such that (m*n)' = u * n' for some natural number u).
Cf. A099307 (least k such that the k-th arithmetic derivative of n is zero).
Cf. A099308 (k-th arithmetic derivative of n is zero for some k).
Cf. A099309 (k-th arithmetic derivative of n is nonzero for all k).
Cf. A129150 (n-th derivative of 2^3).
Cf. A129151 (n-th derivative of 3^4).
Cf. A129152 (n-th derivative of 5^6).
Cf. A189481 (x' = n has a unique solution).
Cf. A190121 (partial sums).
Cf. A258057 (first differences).
Cf. A229501 (n divides the n-th partial sum).
Cf. A165560 (parity).
Cf. A235991 (n' is odd), A235992 (n' is even).
Cf. A327863, A327864, A327865 (n' is a multiple of 3, 4, 5).
Cf. A157037 (n' is prime), A192192 (n'' is prime), A328239 (n''' is prime).
Cf. A328393 (n' is squarefree), A328234 (squarefree and > 1).
Cf. A328244 (n'' is squarefree), A328246 (n''' is squarefree).
Cf. A328303 (n' is not squarefree), A328252 (n' is squarefree, but n is not).
Cf. A328248 (least k such that the (k-1)-th derivative of n is squarefree).
Cf. A328251 (k-th arithmetic derivative is never squarefree for any k >= 0).
Cf. A256750 (least k such that the k-th derivative is either 0 or has a factor p^p).
Cf. A327928 (number of distinct primes p such that p^p divides n').
Cf. A342003 (max. exponent k for any prime power p^k that divides n').
Cf. A327929 (n' has at least one divisor of the form p^p).
Cf. A327978 (n' is primorial number > 1).
Cf. A328243 (n' is a partial sum of primorial numbers and larger than one).
Cf. A328310 (maximal prime exponent of n' minus maximal prime exponent of n).
Cf. A328320 (max. prime exponent of n' is less than that of n).
Cf. A328321 (max. prime exponent of n' is >= that of n).
Cf. A328383 (least k such that the k-th derivative of n is either a multiple or a divisor of n, but not both).
Cf. A263111 (the ordinal transform of a).
Cf. A300251, A319684 (Möbius and inverse Möbius transform).
Cf. A305809 (Dirichlet convolution square).
Cf. A349133, A349173, A349394, A349380, A349618, A349619, A349620, A349621 (for miscellaneous Dirichlet convolutions).
Cf. A069359 (similar formula which agrees on squarefree numbers).
Cf. A258851 (the pi-based arithmetic derivative of n).
Cf. A328768, A328769 (primorial-based arithmetic derivatives of n).
Cf. A328845, A328846 (Fibonacci-based arithmetic derivatives of n).
Cf. A302055, A327963, A327965, A328099 (for other variants and modifications).
Cf. A038554 (another sequence using "derivative" in its name, but involving binary expansion of n).
Cf. A322582, A348507 (lower and upper bounds), also A002620.

Programs

  • GAP
    A003415:= Concatenation([0,0],List(List([2..10^3],Factors),
    i->Product(i)*Sum(i,j->1/j))); # Muniru A Asiru, Aug 31 2017
    (APL, Dyalog dialect) A003415 ← { ⍺←(0 1 2) ⋄ ⍵≤1:⊃⍺ ⋄ 0=(3⊃⍺)|⍵:((⊃⍺+(2⊃⍺)×(⍵÷3⊃⍺)) ((2⊃⍺)×(3⊃⍺)) (3⊃⍺)) ∇ ⍵÷3⊃⍺ ⋄ ((⊃⍺) (2⊃⍺) (1+(3⊃⍺))) ∇ ⍵} ⍝ Antti Karttunen, Feb 18 2024
  • Haskell
    a003415 0 = 0
    a003415 n = ad n a000040_list where
      ad 1 _             = 0
      ad n ps'@(p:ps)
         | n < p * p     = 1
         | r > 0         = ad n ps
         | otherwise     = n' + p * ad n' ps' where
           (n',r) = divMod n p
    -- Reinhard Zumkeller, May 09 2011
    
  • Magma
    Ad:=func; [n le 1 select 0 else Ad(n): n in [0..80]]; // Bruno Berselli, Oct 22 2013
    
  • Maple
    A003415 := proc(n) local B,m,i,t1,t2,t3; B := 1000000000039; if n<=1 then RETURN(0); fi; if isprime(n) then RETURN(1); fi; t1 := ifactor(B*n); m := nops(t1); t2 := 0; for i from 1 to m do t3 := op(i,t1); if nops(t3) = 1 then t2 := t2+1/op(t3); else t2 := t2+op(2,t3)/op(op(1,t3)); fi od: t2 := t2-1/B; n*t2; end;
    A003415 := proc(n)
            local a,f;
            a := 0 ;
            for f in ifactors(n)[2] do
                    a := a+ op(2,f)/op(1,f);
            end do;
            n*a ;
    end proc: # R. J. Mathar, Apr 05 2012
  • Mathematica
    a[ n_] := If[ Abs @ n < 2, 0, n Total[ #2 / #1 & @@@ FactorInteger[ Abs @ n]]]; (* Michael Somos, Apr 12 2011 *)
    dn[0] = 0; dn[1] = 0; dn[n_?Negative] := -dn[-n]; dn[n_] := Module[{f = Transpose[FactorInteger[n]]}, If[PrimeQ[n], 1, Total[n*f[[2]]/f[[1]]]]]; Table[dn[n], {n, 0, 100}] (* T. D. Noe, Sep 28 2012 *)
  • PARI
    A003415(n) = {local(fac);if(n<1,0,fac=factor(n);sum(i=1,matsize(fac)[1],n*fac[i,2]/fac[i,1]))} /* Michael B. Porter, Nov 25 2009 */
    
  • PARI
    apply( A003415(n)=vecsum([n/f[1]*f[2]|f<-factor(n+!n)~]), [0..99]) \\ M. F. Hasler, Sep 25 2013, updated Nov 27 2019
    
  • PARI
    A003415(n) = { my(s=0, m=1, spf); while(n>1, spf = A020639(n); n /= spf; s += m*n; m *= spf); (s); }; \\ Antti Karttunen, Mar 10 2021
    
  • PARI
    a(n) = my(f=factor(n), r=[1/(e+!e)|e<-f[,1]], c=f[,2]); n*r*c; \\ Ruud H.G. van Tol, Sep 03 2023
    
  • Python
    from sympy import factorint
    def A003415(n):
        return sum([int(n*e/p) for p,e in factorint(n).items()]) if n > 1 else 0
    # Chai Wah Wu, Aug 21 2014
    
  • Sage
    def A003415(n):
        F = [] if n == 0 else factor(n)
        return n * sum(g / f for f, g in F)
    [A003415(n) for n in range(79)] # Peter Luschny, Aug 23 2014
    

Formula

If n = Product p_i^e_i, a(n) = n * Sum (e_i/p_i).
a(m*p^p) = (m + a(m))*p^p, p prime: a(m*A051674(k))=A129283(m)*A051674(k). - Reinhard Zumkeller, Apr 07 2007
For n > 1: a(n) = a(A032742(n)) * A020639(n) + A032742(n). - Reinhard Zumkeller, May 09 2011
a(n) = n * Sum_{p|n} v_p(n)/p, where v_p(n) is the largest power of the prime p dividing n. - Wesley Ivan Hurt, Jul 12 2015
For n >= 2, Sum_{k=2..n} floor(1/a(k)) = pi(n) = A000720(n) (see K. T. Atanassov article). - Ivan N. Ianakiev, Mar 22 2019
From A.H.M. Smeets, Jan 17 2020: (Start)
Limit_{n -> oo} (1/n^2)*Sum_{i=1..n} a(i) = A136141/2.
Limit_{n -> oo} (1/n)*Sum_{i=1..n} a(i)/i = A136141.
a(n) = n if and only if n = p^p, where p is a prime number. (End)
Dirichlet g.f.: zeta(s-1)*Sum_{p prime} 1/(p^s-p), see A136141 (s=2), A369632 (s=3) [Haukkanen, Merikoski and Tossavainen]. - Sebastian Karlsson, Nov 25 2021
From Antti Karttunen, Nov 25 2021: (Start)
a(n) = Sum_{d|n} d * A349394(n/d).
For all n >= 1, A322582(n) <= a(n) <= A348507(n).
If n is not a prime, then a(n) >= 2*sqrt(n), or in other words, for all k >= 1 for which A002620(n)+k is not a prime, we have a(A002620(n)+k) > n. [See Ufnarovski and Åhlander, Theorem 9, point (3).]
(End)

Extensions

More terms from Michel ten Voorde, Apr 11 2001

A001359 Lesser of twin primes.

Original entry on oeis.org

3, 5, 11, 17, 29, 41, 59, 71, 101, 107, 137, 149, 179, 191, 197, 227, 239, 269, 281, 311, 347, 419, 431, 461, 521, 569, 599, 617, 641, 659, 809, 821, 827, 857, 881, 1019, 1031, 1049, 1061, 1091, 1151, 1229, 1277, 1289, 1301, 1319, 1427, 1451, 1481, 1487, 1607
Offset: 1

Views

Author

Keywords

Comments

Also, solutions to phi(n + 2) = sigma(n). - Conjectured by Jud McCranie, Jan 03 2001; proved by Reinhard Zumkeller, Dec 05 2002
The set of primes for which the weight as defined in A117078 is 3 gives this sequence except for the initial 3. - Rémi Eismann, Feb 15 2007
The set of lesser of twin primes larger than three is a proper subset of the set of primes of the form 3n - 1 (A003627). - Paul Muljadi, Jun 05 2008
It is conjectured that A113910(n+4) = a(n+2) for all n. - Creighton Dement, Jan 15 2009
I would like to conjecture that if f(x) is a series whose terms are x^n, where n represents the terms of sequence A001359, and if we inspect {f(x)}^5, the conjecture is that every term of the expansion, say a_n * x^n, where n is odd and at least equal to 15, has a_n >= 1. This is not true for {f(x)}^k, k = 1, 2, 3 or 4, but appears to be true for k >= 5. - Paul Bruckman (pbruckman(AT)hotmail.com), Feb 03 2009
A164292(a(n)) = 1; A010051(a(n) - 2) = 0 for n > 1. - Reinhard Zumkeller, Mar 29 2010
From Jonathan Sondow, May 22 2010: (Start)
About 15% of primes < 19000 are the lesser of twin primes. About 26% of Ramanujan primes A104272 < 19000 are the lesser of twin primes.
About 46% of primes < 19000 are Ramanujan primes. About 78% of the lesser of twin primes < 19000 are Ramanujan primes.
A reason for the jumps is in Section 7 of "Ramanujan primes and Bertrand's postulate" and in Section 4 of "Ramanujan Primes: Bounds, Runs, Twins, and Gaps". (End)
Primes generated by sequence A040976. - Odimar Fabeny, Jul 12 2010
Primes of the form 2*n - 3 with 2*n - 1 prime n > 2. Primes of the form (n^2 - (n-2)^2)/2 - 1 with (n^2 - (n-2)^2)/2 + 1 prime so sum of two consecutive odd numbers/2 - 1. - Pierre CAMI, Jan 02 2012
Conjecture: For any integers n >= m > 0, there are infinitely many integers b > a(n) such that the number Sum_{k=m..n} a(k)*b^(n-k) (i.e., (a(m), ..., a(n)) in base b) is prime; moreover, when m = 1 there is such an integer b < (n+6)^2. - Zhi-Wei Sun, Mar 26 2013
Except for the initial 3, all terms are congruent to 5 mod 6. One consequence of this is that no term of this sequence appears in A030459. - Alonso del Arte, May 11 2013
Aside from the first term, all terms have digital root 2, 5, or 8. - J. W. Helkenberg, Jul 24 2013
The sequence provides all solutions to the generalized Winkler conjecture (A051451) aside from all multiples of 6. Specifically, these solutions start from n = 3 as a(n) - 3. This gives 8, 14, 26, 38, 56, ... An example from the conjecture is solution 38 from twin prime pairs (3, 5), (41, 43). - Bill McEachen, May 16 2014
Conjecture: a(n)^(1/n) is a strictly decreasing function of n. Namely a(n+1)^(1/(n+1)) < a(n)^(1/n) for all n. This conjecture is true for all a(n) <= 1121784847637957. - Jahangeer Kholdi and Farideh Firoozbakht, Nov 21 2014
a(n) are the only primes, p(j), such that (p(j+m) - p(j)) divides (p(j+m) + p(j)) for some m > 0, where p(j) = A000040(j). For all such cases m=1. It is easy to prove, for j > 1, the only common factor of (p(j+m) - p(j)) and (p(j+m) + p(j)) is 2, and there are no common factors if j = 1. Thus, p(j) and p(j+m) are twin primes. Also see A067829 which includes the prime 3. - Richard R. Forberg, Mar 25 2015
Primes prime(k) such that prime(k)! == 1 (mod prime(k+1)) with the exception of prime(991) = 7841 and other unknown primes prime(k) for which (prime(k)+1)*(prime(k)+2)*...*(prime(k+1)-2) == 1 (mod prime(k+1)) where prime(k+1) - prime(k) > 2. - Thomas Ordowski and Robert Israel, Jul 16 2016
For the twin prime criterion of Clement see the link. In Ribenboim, pp. 259-260 a more detailed proof is given. - Wolfdieter Lang, Oct 11 2017
Conjecture: Half of the twin prime pairs can be expressed as 8n + M where M > 8n and each value of M is a distinct composite integer with no more than two prime factors. For example, when n=1, M=21 as 8 + 21 = 29, the lesser of a twin prime pair. - Martin Michael Musatov, Dec 14 2017
For a discussion of bias in the distribution of twin primes, see my article on the Vixra web site. - Waldemar Puszkarz, May 08 2018
Since 2^p == 2 (mod p) (Fermat's little theorem), these are primes p such that 2^p == q (mod p), where q is the next prime after p. - Thomas Ordowski, Oct 29 2019, edited by M. F. Hasler, Nov 14 2019
The yet unproved "Twin Prime Conjecture" states that this sequence is infinite. - M. F. Hasler, Nov 14 2019
Lesser of the twin primes are the set of elements that occur in both A162566, A275697. Proof: A prime p will only have integer solutions to both (p+1)/g(p) and (p-1)/g(p) when p is the lesser of a twin prime, where g(p) is the gap between p and the next prime, because gcd(p+1,p-1) = 2. - Ryan Bresler, Feb 14 2021
From Lorenzo Sauras Altuzarra, Dec 21 2021: (Start)
J. A. Hervás Contreras observed the subsequence 11, 311, 18311, 1518311, 421518311... (see the links), which led me to conjecture the following statements.
I. If i is an integer greater than 2, then there exist positive integers j and k such that a(j) equals the concatenation of 3k and a(i).
II. If k is a positive integer, then there exist positive integers i and j such that a(j) equals the concatenation of 3k and a(i).
III. If i, j, and r are positive integers such that i > 2 and a(j) equals the concatenation of r and a(i), then 3 divides r. (End)

References

  • Milton Abramowitz and Irene A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 6.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §3.2 Prime Numbers, p. 81.
  • Paulo Ribenboim, The New Book of Prime Number Records, Springer-Verlag NY 1996, pp. 259-260.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 192-197.
  • 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).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 111-112.

Crossrefs

Subsequence of A003627.
Cf. A104272 (Ramanujan primes), A178127 (lesser of twin Ramanujan primes), A178128 (lesser of twin primes if it is a Ramanujan prime).

Programs

  • Haskell
    a001359 n = a001359_list !! (n-1)
    a001359_list = filter ((== 1) . a010051' . (+ 2)) a000040_list
    -- Reinhard Zumkeller, Feb 10 2015
    
  • Magma
    [n: n in PrimesUpTo(1610) | IsPrime(n+2)];  // Bruno Berselli, Feb 28 2011
    
  • Maple
    select(k->isprime(k+2),select(isprime,[$1..1616])); # Peter Luschny, Jul 21 2009
    A001359 := proc(n)
       option remember;
       if n = 1
          then 3;
       else
          p := nextprime(procname(n-1)) ;
          while not isprime(p+2) do
             p := nextprime(p) ;
          end do:
          p ;
       end if;
    end proc: # R. J. Mathar, Sep 03 2011
  • Mathematica
    Select[Prime[Range[253]], PrimeQ[# + 2] &] (* Robert G. Wilson v, Jun 09 2005 *)
    a[n_] := a[n] = (p = NextPrime[a[n - 1]]; While[!PrimeQ[p + 2], p = NextPrime[p]]; p); a[1] = 3; Table[a[n], {n, 51}]  (* Jean-François Alcover, Dec 13 2011, after R. J. Mathar *)
    nextLesserTwinPrime[p_Integer] := Block[{q = p + 2}, While[NextPrime@ q - q > 2, q = NextPrime@ q]; q]; NestList[nextLesserTwinPrime@# &, 3, 50] (* Robert G. Wilson v, May 20 2014 *)
    Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]==2&][[All,1]] (* Harvey P. Dale, Jan 04 2021 *)
    q = Drop[Prepend[p = Prime[Range[100]], 2], -1];
    Flatten[q[[#]] & /@ Position[p - q, 2]] (* Horst H. Manninger, Mar 28 2021 *)
  • PARI
    A001359(n,p=3) = { while( p+2 < (p=nextprime( p+1 )) || n-->0,); p-2}
    /* The following gives a reasonably good estimate for any value of n from 1 to infinity; compare to A146214. */
    A001359est(n) = solve( x=1,5*n^2/log(n+1), 1.320323631693739*intnum(t=2.02,x+1/x,1/log(t)^2)-log(x) +.5 - n)
    /* The constant is A114907; the expression in front of +.5 is an estimate for A071538(x) */ \\  M. F. Hasler, Dec 10 2008
    
  • Python
    from sympy import primerange, isprime
    print([n for n in primerange(1, 2001) if isprime(n + 2)]) # Indranil Ghosh, Jul 20 2017

Formula

a(n) = A077800(2n-1).
A001359 = { n | A071538(n-1) = A071538(n)-1 }; A071538(A001359(n)) = n. - M. F. Hasler, Dec 10 2008
A001359 = { prime(n) : A069830(n) = A087454(n) }. - Juri-Stepan Gerasimov, Aug 23 2011
a(n) = prime(A029707(n)). - R. J. Mathar, Feb 19 2017

A002522 a(n) = n^2 + 1.

Original entry on oeis.org

1, 2, 5, 10, 17, 26, 37, 50, 65, 82, 101, 122, 145, 170, 197, 226, 257, 290, 325, 362, 401, 442, 485, 530, 577, 626, 677, 730, 785, 842, 901, 962, 1025, 1090, 1157, 1226, 1297, 1370, 1445, 1522, 1601, 1682, 1765, 1850, 1937, 2026, 2117, 2210, 2305, 2402, 2501
Offset: 0

Views

Author

Keywords

Comments

An n X n nonnegative matrix A is primitive (see A070322) iff every element of A^k is > 0 for some power k. If A is primitive then the power which should have all positive entries is <= n^2 - 2n + 2 (Wielandt).
a(n) = Phi_4(n), where Phi_k is the k-th cyclotomic polynomial.
As the positive solution to x=2n+1/x is x=n+sqrt(a(n)), the continued fraction expansion of sqrt(a(n)) is {n; 2n, 2n, 2n, 2n, ...}. - Benoit Cloitre, Dec 07 2001
a(n) is one less than the arithmetic mean of its neighbors: a(n) = (a(n-1) + a(n+1))/2 - 1. E.g., 2 = (1+5)/2 - 1, 5 = (2+10)/2 - 1. - Amarnath Murthy, Jul 29 2003
Equivalently, the continued fraction expansion of sqrt(a(n)) is (n;2n,2n,2n,...). - Franz Vrabec, Jan 23 2006
Number of {12,1*2*,21}-avoiding signed permutations in the hyperoctahedral group.
The number of squares of side 1 which can be drawn without lifting the pencil, starting at one corner of an n X n grid and never visiting an edge twice is n^2-2n+2. - Sébastien Dumortier, Jun 16 2005
Also, numbers m such that m^3 - m^2 is a square, (n*(1 + n^2))^2. - Zak Seidov
1 + 2/2 + 2/5 + 2/10 + ... = Pi*coth Pi [Jolley], see A113319. - Gary W. Adamson, Dec 21 2006
For n >= 1, a(n-1) is the minimal number of choices from an n-set such that at least one particular element has been chosen at least n times or each of the n elements has been chosen at least once. Some games define "matches" this way; e.g., in the classic Parker Brothers, now Hasbro, board game Risk, a(2)=5 is the number of cards of three available types (suits) required to guarantee at least one match of three different types or of three of the same type (ignoring any jokers or wildcards). - Rick L. Shepherd, Nov 18 2007
Positive X values of solutions to the equation X^3 + (X - 1)^2 + X - 2 = Y^2. To prove that X = n^2 + 1: Y^2 = X^3 + (X - 1)^2 + X - 2 = X^3 + X^2 - X - 1 = (X - 1)(X^2 + 2X + 1) = (X - 1)*(X + 1)^2 it means: (X - 1) must be a perfect square, so X = n^2 + 1 and Y = n(n^2 + 2). - Mohamed Bouhamida, Nov 29 2007
{a(k): 0 <= k < 4} = divisors of 10. - Reinhard Zumkeller, Jun 17 2009
Appears in A054413 and A086902 in relation to sequences related to the numerators and denominators of continued fractions convergents to sqrt((2*n)^2/4 + 1), n=1, 2, 3, ... . - Johannes W. Meijer, Jun 12 2010
For n > 0, continued fraction [n,n] = n/a(n); e.g., [5,5] = 5/26. - Gary W. Adamson, Jul 15 2010
The only real solution of the form f(x) = A*x^p with negative p which satisfies f^(m)(x) = f^[-1](x), x >= 0, m >= 1, with f^(m) the m-th derivative and f^[-1] the compositional inverse of f, is obtained for m=2*n, p=p(n)= -(sqrt(a(n))-n) and A=A(n)=(fallfac(p(n),2*n))^(-p(n)/(p(n)+1)), with fallfac(x,k):=Product_{j=0..k-1} (x-j) (falling factorials). See the T. Koshy reference, pp. 263-4 (there are also two solutions for positive p, see the corresponding comment in A087475). - Wolfdieter Lang, Oct 21 2010
n + sqrt(a(n)) = [2*n;2*n,2*n,...] with the regular continued fraction with period 1. This is the even case. For the general case see A087475 with the Schroeder reference and comments. For the odd case see A078370.
a(n-1) counts configurations of non-attacking bishops on a 2 X n strip [Chaiken et al., Ann. Combin. 14 (2010) 419]. - R. J. Mathar, Jun 16 2011
Also numbers k such that 4*k-4 is a square. Hence this sequence is the union of A053755 and A069894. - Arkadiusz Wesolowski, Aug 02 2011
a(n) is also the Moore lower bound on the order, A191595(n), of an (n,5)-cage. - Jason Kimberley, Oct 17 2011
Left edge of the triangle in A195437: a(n+1) = A195437(n,0). - Reinhard Zumkeller, Nov 23 2011
If h (5,17,37,65,101,...) is prime is relatively prime to 6, then h^2-1 is divisible by 24. - Vincenzo Librandi, Apr 14 2014
The identity (4*n^2+2)^2 - (n^2+1)*(4*n)^2 = 4 can be written as A005899(n)^2 - a(n)*A008586(n)^2 = 4. - Vincenzo Librandi, Jun 15 2014
a(n) is also the number of permutations simultaneously avoiding 213 and 321 in the classical sense which can be realized as labels on an increasing strict binary tree with 2n-1 nodes. See A245904 for more information on increasing strict binary trees. - Manda Riehl, Aug 07 2014
a(n-1) is the maximum number of stages in the Gale-Shapley algorithm for finding a stable matching between two sets of n elements given an ordering of preferences for each element (see Gura et al.). - Melvin Peralta, Feb 07 2016
Because of Fermat's little theorem, a(n) is never divisible by 3. - Altug Alkan, Apr 08 2016
For n > 0, if a(n) points are placed inside an n X n square, it will always be the case that at least two of the points will be a distance of sqrt(2) units apart or less. - Melvin Peralta, Jan 21 2017
Also the limit as q->1^- of the unimodal polynomial (1-q^(n*k+1))/(1-q) after making the simplification k=n. The unimodal polynomial is from O'Hara's proof of unimodality of q-binomials after making the restriction to partitions of size <= 1. See G_1(n,k) from arXiv:1711.11252. As the size restriction s increases, G_s->G_infinity=G: the q-binomials. Then substituting k=n and q=1 yields the central binomial coefficients: A000984. - Bryan T. Ek, Apr 11 2018
a(n) is the smallest number congruent to both 1 (mod n) and 2 (mod n+1). - David James Sycamore, Apr 04 2019
a(n) is the number of permutations of 1,2,...,n+1 with exactly one reduced decomposition. - Richard Stanley, Dec 22 2022
From Klaus Purath, Apr 03 2025: (Start)
The odd prime factors of these terms are always of the form 4*k + 1.
All a(n) = D satisfy the Pell equation (k*x)^2 - D*y^2 = -1. The values for k and the solutions x, y can be calculated using the following algorithm: k = n, x(0) = 1, x(1) = 4*D - 1, y(0) = 1, y(1) = 4*D - 3. The two recurrences are of the form (4*D - 2, -1). The solutions x, y of the Pell equations for n = {1 ... 14} are in OEIS.
It follows from the above that this sequence is a subsequence of A031396. (End)

Examples

			G.f. = 1 + 2*x + 5*x^2 + 10*x^3 + 17*x^4 + 26*x^5 + 37*x^6 + 50*x^7 + 65*x^8 + ...
		

References

  • S. J. Cyvin and I. Gutman, Kekulé structures in benzenoid hydrocarbons, Lecture Notes in Chemistry, No. 46, Springer, New York, 1988 (see p. 120).
  • E. Gura and M. Maschler, Insights into Game Theory: An Alternative Mathematical Experience, Cambridge, 2008; p. 26.
  • Thomas Koshy, Fibonacci and Lucas Numbers with Applications, John Wiley and Sons, New York, 2001.

Crossrefs

Left edge of A055096.
Cf. A059100, A117950, A087475, A117951, A114949, A117619 (sequences of form n^2 + K).
a(n+1) = A101220(n, n+1, 3).
Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), A027383 (k=3), A062318 (k=4), A061547 (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), this sequence (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A002496 (primes).
Cf. A254858.
Subsequence of A031396.

Programs

Formula

O.g.f.: (1-x+2*x^2)/((1-x)^3). - Eric Werley, Jun 27 2011
Sequences of the form a(n) = n^2 + K with offset 0 have o.g.f. (K - 2*K*x + K*x^2 + x + x^2)/(1-x)^3 and recurrence a(n) = 3*a(n-1) - 3*a(n-2) + a*(n-3). - R. J. Mathar, Apr 28 2008
For n > 0: a(n-1) = A143053(A000290(n)) - 1. - Reinhard Zumkeller, Jul 20 2008
A143053(a(n)) = A000290(n+1). - Reinhard Zumkeller, Jul 20 2008
a(n)*a(n-2) = (n-1)^4 + 4. - Reinhard Zumkeller, Feb 12 2009
a(n) = A156798(n)/A087475(n). - Reinhard Zumkeller, Feb 16 2009
From Reinhard Zumkeller, Mar 08 2010: (Start)
a(n) = A170949(A002061(n+1));
A170949(a(n)) = A132411(n+1);
A170950(a(n)) = A002061(n+1). (End)
For n > 1, a(n)^2 + (a(n) + 1)^2 + ... + (a(n) + n - 2)^2 + (a(n) + n - 1 + a(n) + n)^2 = (n+1) *(6*n^4 + 18*n^3 + 26*n^2 + 19*n + 6) / 6 = (a(n) + n)^2 + ... + (a(n) + 2*n)^2. - Charlie Marion, Jan 10 2011
From Eric Werley, Jun 27 2011: (Start)
a(n) = 2*a(n-1) - a(n-2) + 2.
a(n) = a(n-1) + 2*n - 1. (End)
a(n) = (n-1)^2 + 2(n-1) + 2 = 122 read in base n-1 (for n > 3). - Jason Kimberley, Oct 20 2011
a(n)*a(n+1) = a(n*(n+1) + 1) so a(1)*a(2) = a(3). More generally, a(n)*a(n+k) = a(n*(n+k) + 1) + k^2 - 1. - Jon Perry, Aug 01 2012
a(n) = (n!)^2* [x^n] BesselI(0, 2*sqrt(x))*(1+x). - Peter Luschny, Aug 25 2012
a(n) = A070216(n,1) for n > 0. - Reinhard Zumkeller, Nov 11 2012
E.g.f.: exp(x)*(1 + x + x^2). - Geoffrey Critzer, Aug 30 2013
a(n) = A254858(n-2,3) for n > 2. - Reinhard Zumkeller, Feb 09 2015
Sum_{n>=0} (-1)^n / a(n) = (1+Pi/sinh(Pi))/2 = 0.636014527491... = A367976 . - Vaclav Kotesovec, Feb 14 2015
Sum_{n>=0} 1/a(n) = (1 + Pi*coth(Pi))/2 = 2.076674... = A113319. - Vaclav Kotesovec, Apr 10 2016
4*a(n) = A001105(n-1) + A001105(n+1). - Bruno Berselli, Jul 03 2017
From Amiram Eldar, Jan 20 2021: (Start)
Product_{n>=0} (1 + 1/a(n)) = sqrt(2)*csch(Pi)*sinh(sqrt(2)*Pi).
Product_{n>=1} (1 - 1/a(n)) = Pi*csch(Pi). (End)
Sum_{n>=0} a(n)/n! = 3*e. - Davide Rotondo, Feb 16 2025

Extensions

Partially edited by Joerg Arndt, Mar 11 2010

A001567 Fermat pseudoprimes to base 2, also called Sarrus numbers or Poulet numbers.

Original entry on oeis.org

341, 561, 645, 1105, 1387, 1729, 1905, 2047, 2465, 2701, 2821, 3277, 4033, 4369, 4371, 4681, 5461, 6601, 7957, 8321, 8481, 8911, 10261, 10585, 11305, 12801, 13741, 13747, 13981, 14491, 15709, 15841, 16705, 18705, 18721, 19951, 23001, 23377, 25761, 29341
Offset: 1

Views

Author

Keywords

Comments

A composite number n is a Fermat pseudoprime to base b if and only if b^(n-1) == 1 (mod n). Fermat pseudoprimes to base 2 are often simply called pseudoprimes.
Theorem: If both numbers q and 2q - 1 are primes (q is in the sequence A005382) and n = q*(2q-1) then 2^(n-1) == 1 (mod n) (n is in the sequence) if and only if q is of the form 12k + 1. The sequence 2701, 18721, 49141, 104653, 226801, 665281, 721801, ... is related. This subsequence is also a subsequence of the sequences A005937 and A020137. - Farideh Firoozbakht, Sep 15 2006
Also, composite odd numbers n such that n divides 2^n - 2 (cf. A006935). It is known that all primes p divide 2^(p-1) - 1. There are only two known numbers n such that n^2 divides 2^(n-1) - 1, A001220(n) = {1093, 3511} Wieferich primes p: p^2 divides 2^(p-1) - 1. 1093^2 and 3511^2 are the terms of a(n). - Alexander Adamchuk, Nov 06 2006
An odd composite number 2n + 1 is in the sequence if and only if multiplicative order of 2 (mod 2n+1) divides 2n. - Ray Chandler, May 26 2008
The Carmichael numbers A002997 are a subset of this sequence. For the Sarrus numbers which are not Carmichael numbers, see A153508. - Artur Jasinski, Dec 28 2008
An odd number n greater than 1 is a Fermat pseudoprime to base b if and only if ((n-1)! - 1)*b^(n-1) == -1 (mod n). - Arkadiusz Wesolowski, Aug 20 2012
The name "Sarrus numbers" is after Frédéric Sarrus, who, in 1819, discovered that 341 is a counterexample to the "Chinese hypothesis" that n is prime if and only if 2^n is congruent to 2 (mod n). - Alonso del Arte, Apr 28 2013
The name "Poulet numbers" appears in Monografie Matematyczne 42 from 1932, apparently because Poulet in 1928 produced a list of these numbers (cf. Miller, 1975). - Felix Fröhlich, Aug 18 2014
Numbers n > 2 such that (n-1)! + 2^(n-1) == 1 (mod n). Composite numbers n such that (n-2)^(n-1) == 1 (mod n). - Thomas Ordowski, Feb 20 2016
The only twin pseudoprimes up to 10^13 are 4369, 4371. - Thomas Ordowski, Feb 12 2016
Theorem (A. Rotkiewicz, 1965): (2^p-1)*(2^q-1) is a pseudoprime if and only if p*q is a pseudoprime, where p,q are different primes. - Thomas Ordowski, Mar 31 2016
Theorem (W. Sierpiński, 1947): if n is a pseudoprime (odd or even), then 2^n-1 is a pseudoprime. - Thomas Ordowski, Apr 01 2016
If 2^n-1 is a pseudoprime, then n is a prime or a pseudoprime (odd or even). - Thomas Ordowski, Sep 05 2016
From Amiram Eldar, Jun 19 2021, Apr 21 2024: (Start)
Erdős (1950) called these numbers "almost primes".
According to Erdős (1949) and Piza (1954), the term "pseudoprime" was coined by D. H. Lehmer.
Named after the French mathematician Pierre de Fermat (1607-1665), or, alternatively, after the Belgian mathematician Paul Poulet (1887-1946), or, the French mathematician Pierre Frédéric Sarrus (1798-1861). (End)
If m is a term of this sequence, then (m-1)/ord(2,m) >= 5, where ord(a,m) is the multiplicative order of a modulo m; see my link below. Actually, it seems that we always have (m-1)/ord(2,m) >= 9. - Jianing Song, Nov 04 2024

References

  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §3.2 Prime Numbers, p. 80.
  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section A12, pp. 44-50.
  • George P. Loweke, The Lore of Prime Numbers. New York: Vantage Press (1982), p. 22.
  • Øystein Ore, Number Theory and Its History, McGraw-Hill, 1948.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 88-92.
  • 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).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 145.

Crossrefs

Cf. A001220 = Wieferich primes p: p^2 divides 2^(p-1) - 1.
Cf. A005935, A005936, A005937, A005938, A005939, A020136-A020228 (pseudoprimes to bases 3 through 100).

Programs

  • Magma
    [n: n in [3..3*10^4 by 2] | IsOne(Modexp(2,n-1,n)) and not IsPrime(n)]; // Bruno Berselli, Jan 17 2013
  • Maple
    select(t -> not isprime(t) and 2 &^(t-1) mod t = 1, [seq(i,i=3..10^5,2)]); # Robert Israel, Feb 18 2016
  • Mathematica
    Select[Range[3,30000,2], ! PrimeQ[ # ] && PowerMod[2, (# - 1), # ] == 1 &] (* Farideh Firoozbakht, Sep 15 2006 *)
  • PARI
    q=1;vector(50,i,until( !isprime(q) & (1<<(q-1)-1)%q == 0, q+=2);q) \\ M. F. Hasler, May 04 2007
    
  • PARI
    is_A001567(n)={Mod(2,n)^(n-1)==1 && !isprime(n) && n>1}  \\ M. F. Hasler, Oct 07 2012, updated to current PARI syntax and to exclude even pseudoprimes on Mar 01 2019
    

Formula

Sum_{n>=1} 1/a(n) is in the interval (0.015260, 33) (Bayless and Kinlaw, 2017). The upper bound was reduced to 0.0911 by Kinlaw (2023). - Amiram Eldar, Oct 15 2020, Feb 24 2024

Extensions

More terms from David W. Wilson, Aug 15 1996
Replacement of broken geocities link by Jason G. Wurtzel, Sep 05 2010
"Poulet numbers" added to name by Joerg Arndt, Aug 18 2014

A002997 Carmichael numbers: composite numbers k such that a^(k-1) == 1 (mod k) for every a coprime to k.

Original entry on oeis.org

561, 1105, 1729, 2465, 2821, 6601, 8911, 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
Offset: 1

Views

Author

Keywords

Comments

V. Šimerka found the first 7 terms of this sequence 25 years before Carmichael (see the link and also the remark of K. Conrad). - Peter Luschny, Apr 01 2019
k is composite and squarefree and for p prime, p|k => p-1|k-1.
An odd composite number k is a pseudoprime to base a iff a^(k-1) == 1 (mod k). A Carmichael number is an odd composite number k which is a pseudoprime to base a for every number a prime to k.
A composite odd number k is a Carmichael number if and only if k is squarefree and p-1 divides k-1 for every prime p dividing k. (Korselt, 1899)
Ghatage and Scott prove using Fermat's little theorem that (a+b)^k == a^k + b^k (mod k) (the freshman's dream) exactly when k is a prime (A000040) or a Carmichael number. - Jonathan Vos Post, Aug 31 2005
Alford et al. have constructed a Carmichael number with 10333229505 prime factors, and have also constructed Carmichael numbers with m prime factors for every m between 3 and 19565220. - Jonathan Vos Post, Apr 01 2012
Thomas Wright proved that for any numbers b and M in N with gcd(b,M) = 1, there are infinitely many Carmichael numbers k such that k == b (mod M). - Jonathan Vos Post, Dec 27 2012
Composite numbers k relatively prime to 1^(k-1) + 2^(k-1) + ... + (k-1)^(k-1). - Thomas Ordowski, Oct 09 2013
Composite numbers k such that A063994(k) = A000010(k). - Thomas Ordowski, Dec 17 2013
Odd composite numbers k such that k divides A002445((k-1)/2). - Robert Israel, Oct 02 2015
If k is a Carmichael number and gcd(b-1,k)=1, then (b^k-1)/(b-1) is a pseudoprime to base b by Steuerwald's theorem; see the reference in A005935. - Thomas Ordowski, Apr 17 2016
Composite numbers k such that p^k == p (mod k) for every prime p <= A285512(k). - Max Alekseyev and Thomas Ordowski, Apr 20 2017
If a composite m < A285549(n) and p^m == p (mod m) for every prime p <= prime(n), then m is a Carmichael number. - Thomas Ordowski, Apr 23 2017
The sequence of all Carmichael numbers can be defined as follows: a(1) = 561, a(n+1) = smallest composite k > a(n) such that p^k == p (mod k) for every prime p <= n+2. - Thomas Ordowski, Apr 24 2017
An integer m > 1 is a Carmichael number if and only if m is squarefree and each of its prime divisors p satisfies both s_p(m) >= p and s_p(m) == 1 (mod p-1), where s_p(m) is the sum of the base-p digits of m. Then m is odd and has at least three prime factors. For each prime factor p, the sharp bound p <= a*sqrt(m) holds with a = sqrt(17/33) = 0.7177.... See Kellner and Sondow 2019. - Bernd C. Kellner and Jonathan Sondow, Mar 03 2019
Carmichael numbers are special polygonal numbers A324973. The rank of the n-th Carmichael number is A324975(n). See Kellner and Sondow 2019. - Jonathan Sondow, Mar 26 2019
An odd composite number m is a Carmichael number iff m divides denominator(Bernoulli(m-1)). The quotient is A324977. See Pomerance, Selfridge, & Wagstaff, p. 1006, and Kellner & Sondow, section on Bernoulli numbers. - Jonathan Sondow, Mar 28 2019
This is setwise difference A324050 \ A008578. Many of the same identities apply also to A324050. - Antti Karttunen, Apr 22 2019
If k is a Carmichael number, then A309132(k) = A326690(k). The proof generalizes that of Theorem in A309132. - Jonathan Sondow, Jul 19 2019
Composite numbers k such that A111076(k)^(k-1) == 1 (mod k). Proof: the multiplicative order of A111076(k) mod k is equal to lambda(k), where lambda(k) = A002322(k), so lambda(k) divides k-1, qed. - Thomas Ordowski, Nov 14 2019
For all positive integers m, m^k - m is divisible by k, for all k > 1, iff k is either a Carmichael number or a prime, as is used in the proof by induction for Fermat's Little Theorem. Also related are A182816 and A121707. - Richard R. Forberg, Jul 18 2020
From Amiram Eldar, Dec 04 2020, Apr 21 2024: (Start)
Ore (1948) called these numbers "Numbers with the Fermat property", or, for short, "F numbers".
Also called "absolute pseudoprimes". According to Erdős (1949) this term was coined by D. H. Lehmer.
Named by Beeger (1950) after the American mathematician Robert Daniel Carmichael (1879 - 1967). (End)
For ending digit 1,3,5,7,9 through the first 10000 terms, we see 80.3, 4.1, 7.4, 3.8 and 4.3% apportionment respectively. Why the bias towards ending digit "1"? - Bill McEachen, Jul 16 2021
It seems that for any m > 1, the remainders of Carmichael numbers modulo m are biased towards 1. The number of terms congruent to 1 modulo 4, 6, 8, ..., 24 among the first 10000 terms: 9827, 9854, 8652, 8034, 9682, 5685, 6798, 7820, 7880, 3378 and 8518. - Jianing Song, Nov 08 2021
Alford, Granville and Pomerance conjectured in their 1994 paper that a statement analogous to Bertrand's Postulate could be applied to Carmichael numbers. This has now been proved by Daniel Larsen, see link below. - David James Sycamore, Jan 17 2023

References

  • N. G. W. H. Beeger, On composite numbers n for which a^n == 1 (mod n) for every a prime to n, Scripta Mathematica, Vol. 16 (1950), pp. 133-135.
  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover Publications, Inc. New York, 1966, Table 18, Page 44.
  • David M. Burton, Elementary Number Theory, 5th ed., McGraw-Hill, 2002.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 142.
  • CRC Standard Mathematical Tables and Formulae, 30th ed., 1996, p. 87.
  • Richard K. Guy, Unsolved Problems in Number Theory, A13.
  • Øystein Ore, Number Theory and Its History, McGraw-Hill, 1948, Reprinted by Dover Publications, 1988, Chapter 14.
  • Paul Poulet, Tables des nombres composés vérifiant le théorème du Fermat pour le module 2 jusqu'à 100.000.000, Sphinx (Brussels), 8 (1938), 42-45.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 22, 100-103.
  • Wacław Sierpiński, A Selection of Problems in the Theory of Numbers. Macmillan, NY, 1964, p. 51.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 145-146.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See entry 561 at p. 157.

Crossrefs

Programs

  • Haskell
    a002997 n = a002997_list !! (n-1)
    a002997_list = [x | x <- a024556_list,
    all (== 0) $ map ((mod (x - 1)) . (subtract 1)) $ a027748_row x]
    -- Reinhard Zumkeller, Apr 12 2012
    
  • Magma
    [n: n in [3..53*10^4 by 2] | not IsPrime(n) and n mod CarmichaelLambda(n) eq 1]; // Bruno Berselli, Apr 23 2012
    
  • Maple
    filter:= proc(n)
      local q;
      if isprime(n) then return false fi;
      if 2 &^ (n-1) mod n <> 1 then return false fi;
      if not numtheory:-issqrfree(n) then return false fi;
      for q in numtheory:-factorset(n) do
        if (n-1) mod (q-1) <> 0 then return false fi
      od:
      true;
    end proc:
    select(filter, [seq(2*k+1,k=1..10^6)]); # Robert Israel, Dec 29 2014
    isA002997 := n -> 0 = modp(n-1, numtheory:-lambda(n)) and not isprime(n) and n <> 1:
    select(isA002997, [$1..10000]); # Peter Luschny, Jul 21 2019
  • Mathematica
    Cases[Range[1,100000,2], n_ /; Mod[n, CarmichaelLambda[n]] == 1 && ! PrimeQ[n]] (* Artur Jasinski, Apr 05 2008; minor edit from Zak Seidov, Feb 16 2011 *)
    Select[Range[1,600001,2],CompositeQ[#]&&Mod[#,CarmichaelLambda[#]]==1&] (* Harvey P. Dale, Jul 08 2023 *)
  • PARI
    Korselt(n)=my(f=factor(n));for(i=1,#f[,1],if(f[i,2]>1||(n-1)%(f[i,1]-1),return(0)));1
    isA002997(n)=n%2 && !isprime(n) && Korselt(n) && n>1 \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    is_A002997(n, F=factor(n)~)={ #F>2 && !foreach(F,f,(n%(f[1]-1)==1 && f[2]==1) || return)} \\ No need to check parity: if efficiency is needed, scan only odd numbers. - M. F. Hasler, Aug 24 2012, edited Mar 24 2022
    
  • Python
    from itertools import islice
    from sympy import nextprime, factorint
    def A002997_gen(): # generator of terms
        p, q = 3, 5
        while True:
            for n in range(p+2,q,2):
                f = factorint(n)
                if max(f.values()) == 1 and not any((n-1) % (p-1) for p in f):
                    yield n
            p, q = q, nextprime(q)
    A002997_list = list(islice(A002997_gen(),20)) # Chai Wah Wu, May 11 2022
  • Sage
    def isCarmichael(n):
        if n == 1 or is_even(n) or is_prime(n):
            return False
        factors = factor(n)
        for f in factors:
            if f[1] > 1: return False
            if (n - 1) % (f[0] - 1) != 0:
                return False
        return True
    print([n for n in (1..20000) if isCarmichael(n)]) # Peter Luschny, Apr 02 2019
    

Formula

Sum_{n>=1} 1/a(n) is in the interval (0.004706, 27.8724) (Bayless and Kinlaw, 2017). The upper bound was reduced to 0.0058 by Kinlaw (2023). - Amiram Eldar, Oct 26 2020, Feb 24 2024

Extensions

Links for lists of Carmichael numbers updated by Jan Kristian Haugland, Mar 25 2009 and Danny Rorabaugh, May 05 2017

A026741 a(n) = n if n odd, n/2 if n even.

Original entry on oeis.org

0, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38
Offset: 0

Views

Author

J. Carl Bellinger (carlb(AT)ctron.com)

Keywords

Comments

a(n) is the size of largest conjugacy class in D_2n, the dihedral group with 2n elements. - Sharon Sela (sharonsela(AT)hotmail.com), May 14 2002
a(n+1) is the composition length of the n-th symmetric power of the natural representation of a finite subgroup of SL(2,C) of type D_4 (quaternion group). - Paul Boddington, Oct 23 2003
For n > 1, a(n) is the greatest common divisor of all permutations of {0, 1, ..., n} treated as base n + 1 integers. - David Scambler, Nov 08 2006 (see the Mathematics Stack Exchange link below).
From Dimitrios Choussos (choussos(AT)yahoo.de), May 11 2009: (Start)
Sequence A075888 and the above sequence are fitting together.
First 2 entries of this sequence have to be taken out.
In some cases two three or more sequenced entries of this sequence have to be added together to get the next entry of A075888.
Example: Sequences begin with 1, 3, 2, 5, 3, 7, 4, 9 (4 + 9 = 13, the next entry in A075888).
But it works out well up to primes around 50000 (haven't tested higher ones).
As A075888 gives a very regular graph. There seems to be a regularity in the primes. (End)
Starting with 1 = triangle A115359 * [1, 2, 3, ...]. - Gary W. Adamson, Nov 27 2009
From Gary W. Adamson, Dec 11 2009: (Start)
Let M be an infinite lower triangular matrix with (1, 1, 1, 0, 0, 0, ...) in every column, shifted down twice. This sequence starting with 1 = M * (1, 2, 3, ...)
M =
1;
1, 0;
1, 1, 0;
0, 1, 0, 0;
0, 1, 1, 0, 0;
0, 0, 1, 0, 0, 0;
0, 0, 1, 1, 0, 0, 0;
...
A026741 = M * (1, 2, 3, ...); but A002487 = lim_{n->infinity} M^n, a left-shifted vector considered as a sequence. (End)
A particular case of sequence for which a(n+3) = (a(n+2) * a(n+1)+q)/a(n) for every n > n0. Here n0 = 1 and q = -1. - Richard Choulet, Mar 01 2010
For n >= 2, a(n+1) is the smallest m such that s_n(2*m*(n-1))/(n-1) is even, where s_b(c) is the sum of digits of c in base b. - Vladimir Shevelev, May 02 2011
A001477 and A005408 interleaved. - Omar E. Pol, Aug 22 2011
Numerator of n/((n-1)*(n-2)). - Michael B. Porter, Mar 18 2012
Number of odd terms of n-th row in the triangles A162610 and A209297. - Reinhard Zumkeller, Jan 19 2013
For n >= 3, a(n) is the periodic of integer of spiral length ratio of spiral that have (n-1) circle centers. See illustration in links. - Kival Ngaokrajang, Dec 28 2013
This is the sequence of Lehmer numbers u_n(sqrt(R), Q) with the parameters R = 4 and Q = 1. It is a strong divisibility sequence, that is, gcd(a(n), a(m)) = a(gcd(n, m)) for all natural numbers n and m. Cf. A005013 and A108412. - Peter Bala, Apr 18 2014
The sequence of convergents of the 2-periodic continued fraction [0; 1, -4, 1, -4, ...] = 1/(1 - 1/(4 - 1/(1 - 1/(4 - ...)))) = 2 begins [0/1, 1/1, 4/3, 3/2, 8/5, 5/3, 12/7, ...]. The present sequence is the sequence of denominators; the sequence of numerators of the continued fraction convergents [0, 1, 4, 3, 8, 5, 12, ...] is A022998, also a strong divisibility sequence. - Peter Bala, May 19 2014
For n >= 3, (a(n-2)/a(n))*Pi = vertex angle of a regular n-gon. See illustration in links. - Kival Ngaokrajang, Jul 17 2014
For n > 1, the numerator of the harmonic mean of the first n triangular numbers. - Colin Barker, Nov 13 2014
The difference sequence is a permutation of the integers. - Clark Kimberling, Apr 19 2015
From Timothy Hopper, Feb 26 2017: (Start)
Given the function a(n, p) = n/p if n mod p = 0, else n, then a possible formula is: a(n, p) = n*(1 + (p-1)*((n^(p-1)) mod p))/p, p prime, (n^(p-1)) mod p = 1, n not divisible by p. (Fermat's Little Theorem). Examples: p = 2; a(n), p = 3; A051176(n), p = 5; A060791(n), p = 7; A106608(n).
Conjecture: lcm(n, p) = p*a(n, p), gcd(n, p) = n/a(n, p). (End)
Let r(n) = (a(n+1) + 1)/a(n+1) if n mod 2 = 1, a(n+1)/(a(n+1) + 2) otherwise; then lim_{k->oo} 2^(k+2) * Product_{n=0..k} r(n)^(k-n) = Pi. - Dimitris Valianatos, Mar 22 2021
Number of integers k from 1 to n such that gcd(n,k) is odd. - Amiram Eldar, May 18 2025

Examples

			G.f. = x + x^2 + 3*x^3 + 2*x^4 + 5*x^5 + 3*x^6 + 7*x^7 + 4*x^8 + ...
		

References

  • David Wells, Prime Numbers: The Most Mysterious Figures in Math. Hoboken, New Jersey: John Wiley & Sons (2005), p. 53.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, 2nd Ed. Penguin (1997), p. 79.

Crossrefs

Signed version is in A030640. Partial sums give A001318.
Cf. A051176, A060819, A060791, A060789 for n / gcd(n, k) with k = 3..6. See also A106608 thru A106612 (k = 7 thru 11), A051724 (k = 12), A106614 thru A106621 (k = 13 thru 20).
Cf. A013942.
Cf. A227042 (first column). Cf. A005013 and A108412.

Programs

  • Haskell
    import Data.List (transpose)
    a026741 n = a026741_list !! n
    a026741_list = concat $ transpose [[0..], [1,3..]]
    -- Reinhard Zumkeller, Dec 12 2011
    
  • Magma
    [2*n/(3+(-1)^n): n in [0..70]]; // Vincenzo Librandi, Aug 14 2011
    
  • Maple
    A026741 := proc(n) if type(n,'odd') then n; else n/2; end if; end proc: seq(A026741(n), n=0..76); # R. J. Mathar, Jan 22 2011
  • Mathematica
    Numerator[Abs[Table[Det[DiagonalMatrix[Table[1/i^2 - 1, {i, 1, n - 1}]] + 1], {n, 20}]]] (* Alexander Adamchuk, Jun 02 2006 *)
    halfMax = 40; Riffle[Range[0, halfMax], Range[1, 2halfMax + 1, 2]] (* Harvey P. Dale, Mar 27 2011 *)
    a[ n_] := Numerator[n / 2]; (* Michael Somos, Jan 20 2017 *)
    Array[If[EvenQ[#],#/2,#]&,80,0] (* Harvey P. Dale, Jul 08 2023 *)
  • PARI
    a(n) = numerator(n/2) \\ Rick L. Shepherd, Sep 12 2007
    
  • Python
    def A026741(n): return n if n % 2 else n//2 # Chai Wah Wu, Apr 02 2021
  • Sage
    [lcm(n, 2) / 2 for n in range(77)] # Zerinvary Lajos, Jun 07 2009
    

Formula

G.f.: x*(1 + x + x^2)/(1-x^2)^2. - Len Smiley, Apr 30 2001
a(n) = 2*a(n-2) - a*(n-4) for n >= 4.
a(n) = n * 2^((n mod 2) - 1). - Reinhard Zumkeller, Oct 16 2001
a(n) = 2*n/(3 + (-1)^n). - Benoit Cloitre, Mar 24 2002
Multiplicative with a(2^e) = 2^(e-1) and a(p^e) = p^e, p > 2. - Vladeta Jovovic, Apr 05 2002
a(n) = n / gcd(n, 2). a(n)/A045896(n) = n/((n+1)*(n+2)).
For n > 0, a(n) = denominator of Sum_{i=1..n-1} 2/(i*(i+1)), numerator=A022998. - Reinhard Zumkeller, Apr 21 2012, Jul 25 2002 [thanks to Phil Carmody who noticed an error]
For n > 1, a(n) = GCD of the n-th and (n-1)-th triangular numbers (A000217). - Ross La Haye, Sep 13 2003
Euler transform of finite sequence [1, 2, -1]. - Michael Somos, Jun 15 2005
G.f.: x * (1 - x^3) / ((1 - x) * (1 - x^2)^2) = Sum_{k>0} k * (x^k - x^(2*k)). - Michael Somos, Jun 15 2005
a(n+3) + a(n+2) = 3 + a(n+1) + a(n). a(n+3) * a(n) = - 1 + a(n+2) * a(n+1). a(n) = -a(-n) for all n in Z. - Michael Somos, Jun 15 2005
For n > 1, a(n) is the numerator of the average of 1, 2, ..., n - 1; i.e., numerator of A000217(n-1)/(n-1), with corresponding denominators [1, 2, 1, 2, ...] (A000034). - Rick L. Shepherd, Jun 05 2006
Equals A126988 * (1, -1, 0, 0, 0, ...). - Gary W. Adamson, Apr 17 2007
For n >= 1, a(n) = gcd(n,A000217(n)). - Rick L. Shepherd, Sep 12 2007
a(n) = numerator(n/(2*n-2)) for n >= 2; A022998(n-1) = denominator(n/(2*n-2)) for n >= 2. - Johannes W. Meijer, Jun 18 2009
a(n) = A167192(n+2, 2). - Reinhard Zumkeller, Oct 30 2009
a(n) = A106619(n) * A109012(n). - Paul Curtz, Apr 04 2011
From R. J. Mathar, Apr 18 2011: (Start)
a(n) = A109043(n)/2.
Dirichlet g.f.: zeta(s-1)*(1 - 1/2^s). (End)
a(n) = A001318(n) - A001318(n-1) for n > 0. - Jonathan Sondow, Jan 28 2013
a((2*n+1)*2^p - 1) = 2^p - 1 + n*A151821(p+1), p >= 0 and n >= 0. - Johannes W. Meijer, Feb 03 2013
a(n+1) = denominator(H(n, 1)), n >= 0, with H(n, 1) = 2*n/(n+1) the harmonic mean of n and 1. a(n+1) = A227042(n, 1). See the formula a(n) = n/gcd(n, 2) given above. - Wolfdieter Lang, Jul 04 2013
a(n) = numerator(n/2). - Wesley Ivan Hurt, Oct 02 2013
a(n) = numerator(1 - 2/(n+2)), n >= 0; a(n) = denominator(1 - 2/n), n >= 1. - Kival Ngaokrajang, Jul 17 2014
a(n) = Sum_{i = floor(n/2)..floor((n+1)/2)} i. - Wesley Ivan Hurt, Apr 27 2016
Euler transform of length 3 sequence [1, 2, -1]. - Michael Somos, Jan 20 2017
G.f.: x / (1 - x / (1 - 2*x / (1 + 7*x / (2 - 9*x / (7 - 4*x / (3 - 7*x / (2 + 3*x))))))). - Michael Somos, Jan 20 2017
From Peter Bala, Mar 24 2019: (Start)
a(n) = Sum_{d|n, n/d odd} phi(d), where phi(n) is the Euler totient function A000010.
O.g.f.: Sum_{n >= 1} phi(n)*x^n/(1 - x^(2*n)). (End)
a(n) = A256095(2*n,n). - Alois P. Heinz, Jan 21 2020
E.g.f.: x*(2*cosh(x) + sinh(x))/2. - Stefano Spezia, Apr 28 2023
From Ctibor O. Zizka, Oct 05 2023: (Start)
For k >= 0, a(k) = gcd(k + 1, k*(k + 1)/2).
If (k mod 4) = 0 or 2 then a(k) = (k + 1).
If (k mod 4) = 1 or 3 then a(k) = (k + 1)/2. (End)
Sum_{n=1..oo} 1/a(n)^2 = 7*Pi^2/24. - Stefano Spezia, Dec 02 2023
a(n)*a(n+1) = A000217(n). - Rémy Sigrist, Mar 19 2025

Extensions

Better description from Jud McCranie
Edited by Ralf Stephan, Jun 04 2003

A005248 Bisection of Lucas numbers: a(n) = L(2*n) = A000032(2*n).

Original entry on oeis.org

2, 3, 7, 18, 47, 123, 322, 843, 2207, 5778, 15127, 39603, 103682, 271443, 710647, 1860498, 4870847, 12752043, 33385282, 87403803, 228826127, 599074578, 1568397607, 4106118243, 10749957122, 28143753123, 73681302247, 192900153618, 505019158607, 1322157322203
Offset: 0

Views

Author

Keywords

Comments

Drop initial 2; then iterates of A050411 do not diverge for these starting values. - David W. Wilson
All nonnegative integer solutions of Pell equation a(n)^2 - 5*b(n)^2 = +4 together with b(n)=A001906(n), n>=0. - Wolfdieter Lang, Aug 31 2004
a(n+1) = B^(n)AB(1), n>=0, with compositions of Wythoff's complementary A(n):=A000201(n) and B(n)=A001950(n) sequences. See the W. Lang link under A135817 for the Wythoff representation of numbers (with A as 1 and B as 0 and the argument 1 omitted). E.g., 3=`10`, 7=`010`, 18=`0010`, 47=`00010`, ..., in Wythoff code. a(0) = 2 = B(1) in Wythoff code.
Output of Tesler's formula (as well as that of Lu and Wu) for the number of perfect matchings of an m X n Möbius band where m and n are both even specializes to this sequence for m=2. - Sarah-Marie Belcastro, Jul 04 2009
Numbers having two 1's in their base-phi representation. - Robert G. Wilson v, Sep 13 2010
Pisano period lengths: 1, 3, 4, 3, 2, 12, 8, 6, 12, 6, 5, 12, 14, 24, 4, 12, 18, 12, 9, 6, ... - R. J. Mathar, Aug 10 2012
From Wolfdieter Lang, Feb 18 2013: (Start)
a(n) is also one half of the total number of round trips, each of length 2*n, on the graph P_4 (o-o-o-o) (the simple path with 4 points (vertices) and 3 lines (or edges)). See the array and triangle A198632 for the general case of the graph P_N (there N is n and the length is l=2*k).
O.g.f. for w(4,l) (with zeros for odd l): y*(d/dy)S(4,y)/S(4,y) with y=1/x and Chebyshev S-polynomials (coefficients A049310). See also A198632 for a rewritten form. One half of this o.g.f. for x -> sqrt(x) produces the g.f. (2-3x)/(1-3x+x^2) given below. (End)
Solutions (x, y) = (a(n), a(n+1)) satisfying x^2 + y^2 = 3xy - 5. - Michel Lagneau, Feb 01 2014
Except for the first term, positive values of x (or y) satisfying x^2 - 7xy + y^2 + 45 = 0. - Colin Barker, Feb 16 2014
Except for the first term, positive values of x (or y) satisfying x^2 - 18xy + y^2 + 320 = 0. - Colin Barker, Feb 16 2014
a(n) are the numbers such that a(n)^2-2 are Lucas numbers. - Michel Lagneau, Jul 22 2014
All sequences of this form, b(n+1) = 3*b(n) - b(n-1), regardless of initial values, which includes this sequence, yield this sequence as follows: a(n) = (b(j+n) + b(j-n))/b(j), for any j, except where b(j) = 0. Also note formula below relating this a(n) to all sequences of the form G(n+1) = G(n) + G(n-1). - Richard R. Forberg, Nov 18 2014
A non-simple continued fraction expansion for F(2n*(k+1))/F(2nk) k>=1 is a(n) + (-1)/(a(n) + (-1)/(a(n) + ... + (-1)/a(n))) where a(n) appears exactly k times (F(n) denotes the n-th Fibonacci number). E.g., F(16)/F(12) equals 7 + (-1)/(7 + (-1)/7). Furthermore, these a(n) are exactly the positive integers k such that the non-simple infinite continued fraction k + (-1)/(k + (-1)/(k + (-1)/(k + ...))) belongs to Q(sqrt(5)). Compare to Benoit Cloitre and Thomas Baruchel's comments at A002878. - Greg Dresden, Aug 13 2019
For n >= 1, a(n) is the number of cyclic up-down words of length 2*n over an alphabet of size 3. - Sela Fried, Apr 08 2025

Examples

			G.f. = 2 + 3*x + 7*x^2 + 18*x^3 + 47*x^4 + 123*x^5 + 322*x^6 + 843*x^7 + ... - _Michael Somos_, Aug 11 2009
		

References

  • 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).
  • Richard P. Stanley, Enumerative combinatorics, Vol. 2. Volume 62 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 1999.

Crossrefs

Cf. A000032, A002878 (odd-indexed Lucas numbers), A001906 (Chebyshev S(n-1, 3)), a(n) = sqrt(4+5*A001906(n)^2), A228842.
a(n) = A005592(n)+1 = A004146(n)+2 = A065034(n)-1.
First differences of A002878. Pairwise sums of A001519. First row of array A103997.
Cf. A153415, A201157. Also Lucas(k*n): A000032 (k = 1), A014448 (k = 3), A056854 (k = 4), A001946 (k = 5), A087215 (k = 6), A087281 (k = 7), A087265 (k = 8), A087287 (k = 9), A065705 (k = 10), A089772 (k = 11), A089775 (k = 12).

Programs

  • Haskell
    a005248 n = a005248_list !! n
    a005248_list = zipWith (+) (tail a001519_list) a001519_list
    -- Reinhard Zumkeller, Jan 11 2012
  • Magma
    [Lucas(2*n) : n in [0..100]]; // Vincenzo Librandi, Apr 14 2011
    
  • Maple
    a:= n-> (<<2|3>>. <<3|1>, <-1|0>>^n)[1$2]: seq(a(n), n=0..30); # Alois P. Heinz, Jul 31 2008
    with(combinat): seq(5*fibonacci(n)^2+2*(-1)^n, n= 0..26);
  • Mathematica
    a[0] = 2; a[1] = 3; a[n_] := 3a[n - 1] - a[n - 2]; Table[ a[n], {n, 0, 27}] (* Robert G. Wilson v, Jan 30 2004 *)
    Fibonacci[1 + 2n] + 1/2 (-Fibonacci[2n] + LucasL[2n]) (* Tesler. Sarah-Marie Belcastro, Jul 04 2009 *)
    LinearRecurrence[{3, -1}, {2, 3}, 50] (* Sture Sjöstedt, Nov 27 2011 *)
    LucasL[Range[0,60,2]] (* Harvey P. Dale, Sep 30 2014 *)
  • PARI
    {a(n) = fibonacci(2*n + 1) + fibonacci(2*n - 1)}; /* Michael Somos, Jun 23 2002 */
    
  • PARI
    {a(n) = 2 * subst( poltchebi(n), x, 3/2)}; /* Michael Somos, Jun 28 2003 */
    
  • Sage
    [lucas_number2(n,3,1) for n in range(37)] # Zerinvary Lajos, Jun 25 2008
    

Formula

a(n) = Fibonacci(2*n-1) + Fibonacci(2*n+1).
G.f.: (2-3*x)/(1-3*x+x^2). - Simon Plouffe in his 1992 dissertation.
a(n) = S(n, 3) - S(n-2, 3) = 2*T(n, 3/2) with S(n-1, 3) = A001906(n) and S(-2, x) = -1. U(n, x)=S(n, 2*x) and T(n, x) are Chebyshev's U- and T-polynomials.
a(n) = a(k)*a(n - k) - a(n - 2k) for all k, i.e., a(n) = 2*a(n) - a(n) = 3*a(n - 1) - a(n - 2) = 7*a(n - 2) - a(n - 4) = 18*a(n - 3) - a(n - 6) = 47*a(n - 4) - a(n - 8) etc., a(2n) = a(n)^2 - 2. - Henry Bottomley, May 08 2001
a(n) = A060924(n-1, 0) = 3*A001906(n) - 2*A001906(n-1), n >= 1. - Wolfdieter Lang, Apr 26 2001
a(n) ~ phi^(2*n) where phi=(1+sqrt(5))/2. - Joe Keane (jgk(AT)jgk.org), May 15 2002
a(0)=2, a(1)=3, a(n) = 3*a(n-1) - a(n-2) = a(-n). - Michael Somos, Jun 28 2003
a(n) = phi^(2*n) + phi^(-2*n) where phi=(sqrt(5)+1)/2, the golden ratio. E.g., a(4)=47 because phi^(8) + phi^(-8) = 47. - Dennis P. Walsh, Jul 24 2003
With interpolated zeros, trace(A^n)/4, where A is the adjacency matrix of path graph P_4. Binomial transform is then A049680. - Paul Barry, Apr 24 2004
a(n) = (floor((3+sqrt(5))^n) + 1)/2^n. - Lekraj Beedassy, Oct 22 2004
a(n) = ((3-sqrt(5))^n + (3+sqrt(5))^n)/2^n (Note: substituting the number 1 for 3 in the last equation gives A000204, substituting 5 for 3 gives A020876). - Creighton Dement, Apr 19 2005
a(n) = (1/(n+1/2))*Sum_{k=0..n} B(2k)*L(2n+1-2k)*binomial(2n+1, 2k) where B(2k) is the (2k)-th Bernoulli number. - Benoit Cloitre, Nov 02 2005
a(n) = term (1,1) in the 1 X 2 matrix [2,3] . [3,1; -1,0]^n. - Alois P. Heinz, Jul 31 2008
a(n) = 2*cosh(2*n*psi), where psi=log((1+sqrt(5))/2). - Al Hakanson, Mar 21 2009
From Sarah-Marie Belcastro, Jul 04 2009: (Start)
a(n) - (a(n) - F(2n))/2 - F(2n+1) = 0. (Tesler)
Product_{r=1..n} (1 + 4*(sin((4r-1)*Pi/(4n)))^2). (Lu/Wu) (End)
a(n) = Fibonacci(2n+6) mod Fibonacci(2n+2), n > 1. - Gary Detlefs, Nov 22 2010
a(n) = 5*Fibonacci(n)^2 + 2*(-1)^n. - Gary Detlefs, Nov 22 2010
a(n) = A033888(n)/A001906(n), n > 0. - Gary Detlefs, Dec 26 2010
a(n) = 2^(2*n) * Sum_{k=1..2} (cos(k*Pi/5))^(2*n). - L. Edson Jeffery, Jan 21 2012
From Peter Bala, Jan 04 2013: (Start)
Let F(x) = Product_{n>=0} (1 + x^(4*n+1))/(1 + x^(4*n+3)). Let alpha = 1/2*(3 - sqrt(5)). This sequence gives the simple continued fraction expansion of 1 + F(alpha) = 2.31829 56058 81914 31334 ... = 2 + 1/(3 + 1/(7 + 1/(18 + ...))).
Also F(-alpha) = 0.64985 97768 07374 32950 has the continued fraction representation 1 - 1/(3 - 1/(7 - 1/(18 - ...))) and the simple continued fraction expansion 1/(1 + 1/((3-2) + 1/(1 + 1/((7-2) + 1/(1 + 1/((18-2) + 1/(1 + ...))))))).
F(alpha)*F(-alpha) has the simple continued fraction expansion 1/(1 + 1/((3^2-4) + 1/(1 + 1/((7^2-4) + 1/(1 + 1/((18^2-4) + 1/(1 + ...))))))).
Added Oct 13 2019: 1/2 + 1/2*F(alpha)/F(-alpha) = 1.5142923542... has the simple continued fraction expansion 1 + 1/((3 - 2) + 1/(1 + 1/((18 - 2) + 1/(1 + 1/(123 - 2) + 1/(1 + ...))))). (End)
G.f.: (W(0)+6)/(5*x), where W(k) = 5*x*k + x - 6 + 6*x*(5*k-9)/W(k+1) (continued fraction). - Sergei N. Gladkovskii, Aug 19 2013
Sum_{n >= 1} 1/( a(n) - 5/a(n) ) = 1. Compare with A001906, A002878 and A023039. - Peter Bala, Nov 29 2013
0 = a(n) * a(n+2) - a(n+1)^2 - 5 for all n in Z. - Michael Somos, Aug 24 2014
a(n) = (G(j+2n) + G(j-2n))/G(j), for n >= 0 and any j, positive or negative, except where G(j) = 0, and for any sequence of the form G(n+1) = G(n) + G(n-1) with any initial values for G(0), G(1), including non-integer values. G(n) includes Lucas, Fibonacci. Compare with A081067 for odd number offsets from j. - Richard R. Forberg, Nov 16 2014
a(n) = [x^n] ( (1 + 3*x + sqrt(1 + 6*x + 5*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
From J. M. Bergot, Oct 28 2015: (Start)
For n>0, a(n) = F(n-1) * L(n) + F(2*n+1) - (-1)^n with F(k) = A000045(k).
For n>1, a(n) = F(n+1) * L(n) + F(2*n-1) - (-1)^n.
For n>2, a(n) = 5*F(2*n-3) + 2*L(n-3) * L(n) + 8*(-1)^n. (End)
For n>1, a(n) = L(n-2)*L(n+2) -7*(-1)^n. - J. M. Bergot, Feb 10 2016
a(n) = 6*F(n-1)*L(n-1) - F(2*n-6) with F(n)=A000045(n) and L(n)=A000032(n). - J. M. Bergot, Apr 21 2017
a(n) = F(2*n) + 2*F(n-1)*L(n) with F(n)=A000045(n) and L(n)=A000032(n). - J. M. Bergot, May 01 2017
E.g.f.: exp(4*x/(1+sqrt(5))^2) + exp((1/4)*(1+sqrt(5))^2*x). - Stefano Spezia, Aug 13 2019
From Peter Bala, Oct 14 2019: (Start)
a(n) = F(2*n+2) - F(2*n-2) = A001906(n+1) - A001906(n-1).
a(n) = trace(M^n), where M is the 2 X 2 matrix [0, 1; 1, 1]^2 = [1, 1; 1, 2].
Consequently the Gauss congruences hold: a(n*p^k) = a(n*p^(k-1)) ( mod p^k ) for all prime p and positive integers n and k. See Zarelua and also Stanley (Ch. 5, Ex. 5.2(a) and its solution).
Sum_{n >= 1} (-1)^(n+1)/( a(n) + 1/a(n) ) = 1/5.
Sum_{n >= 1} (-1)^(n+1)/( a(n) + 3/(a(n) + 2/(a(n))) ) = 1/6.
Sum_{n >= 1} (-1)^(n+1)/( a(n) + 9/(a(n) + 4/(a(n) + 1/(a(n)))) ) = 1/9.
x*exp(Sum_{n >= 1} a(n)*x^/n) = x + 3*x^2 + 8*x^3 + 21*x^4 + ... is the o.g.f. for A001906. (End)
a(n) = n + 2 + Sum_{k=1..n-1} k*a(n-k). - Yu Xiao, May 30 2020
Sum_{n>=1} 1/a(n) = A153415. - Amiram Eldar, Nov 11 2020
Sum_{n>=0} 1/(a(n) + 3) = (2*sqrt(5) + 1)/10 (André-Jeannin, 1991). - Amiram Eldar, Jan 23 2022
a(n) = 2*cosh(2*n*arccsch(2)) = 2*cosh(2*n*asinh(1/2)). - Peter Luschny, May 25 2022
a(n) = (5/2)*(Sum_{k=-n..n} binomial(2*n, n+5*k)) - (1/2)*4^n. - Greg Dresden, Jan 05 2023
a(n) = Sum_{k>=0} Lucas(2*n*k)/(Lucas(2*n)^(k+1)). - Diego Rattaggi, Jan 12 2025

Extensions

Additional comments from Michael Somos, Jun 23 2001

A111441 Numbers k such that the sum of the squares of the first k primes is divisible by k.

Original entry on oeis.org

1, 19, 37, 455, 509, 575, 20597, 202717, 1864637, 542474231, 1139733677, 51283502951, 230026580777, 22148897608321, 51271840444039, 1820988137264459
Offset: 1

Views

Author

Stefan Steinerberger, Nov 14 2005

Keywords

Comments

a(16) > 10^14 if it exists. - Anders Kaseorg, Dec 02 2020
Conjecture: There are no terms that are 3 or 9 modulo 12. This seems to hold for all related sequences with even powers of primes, not just squares. Compare "sums of powers of primes divisibility sequences", linked below. - Daniel Bamberger, Dec 03 2020
From Jacob Christian Munch-Andersen, Dec 13 2020: (Start)
Any prime except 3 raised to the 2nd power is 1 modulo 3. Therefore adding the squared primes together results in a simple periodic pattern modulo 3. Any term that is 0 modulo 3 would imply that it divides a number that is 2 modulo 3; as this is impossible there cannot be any terms divisible by 3.
The same proof indeed holds for similar lists generated with any even power, and a similar proof for instance disqualifies any multiple of 5 from the similar 4th-power list. A slightly simpler similar proof shows that there are no terms divisible by 2.
(End)
The previous comment implies that for a list generated with the m-th power, there are no terms divisible by p when p is prime and p-1 is a divisor of m. For example, the 12th power list has no terms divisible by 2, 3, 5, 7 or 13. - Paul W. Dyson, Jan 09 2021
The periodic pattern of the sum of primes raised to an even power as described in the comments above follows from Fermat's little theorem. When the pattern is periodic for a given p it can be seen that when k mod p = 0 the sum mod p = p-1 and therefore sum mod k cannot be 0. - Bruce Garner, Apr 08 2021
a(2) is also a value in each of the lists generated with the powers 20, 38, 56... . a(3) is also a value in each of the lists generated with the powers 38, 74, 110... . In general, if the sum of the first k primes each to the power of m is divisible by k, and m >= the maximum exponent in the prime factorization of k, then the sum of the first k primes each to the power of m + j * psi(k) is also divisible by k, where psi(k) is the reduced totient function (A002322) and j is any positive integer. This follows from the fact that n^m == n^(m + psi(k)) (mod k) for all integers n and all integers m >= the maximum exponent in the prime factorization of k. - Paul W. Dyson, Dec 09 2022
a(17) > 8*10^15. - Paul W. Dyson, Jan 16 2025

Examples

			The sum of the squares of the first 19 primes 2^2 + 3^2 + 5^2 + ... + 67^2 = 19*1314, thus 19 is in the sequence.
		

Crossrefs

Cf. also A217599, A217600 for the corresponding prime numbers and sums.

Programs

  • Mathematica
    s = 0; t = {}; Do[s = s + Prime[n]^2; If[ Mod[s, n] == 0, AppendTo[t, n]], {n, 10^6}]; t (* Robert G. Wilson v, Nov 15 2005 *)
    Module[{nn=2*10^6,pr2},pr2=Accumulate[Prime[Range[nn]]^2];Select[Thread[{Range[nn],pr2}],Divisible[#[[2]],#[[1]]]&]][[;;,1]] (* The program generates the first 9 terms of the sequence. *) (* Harvey P. Dale, May 25 2025 *)
  • MuPAD
    a := 0; for n from 1 to 100000 do a := a + ithprime(n)^2; if a/n = trunc(a/n) then print(n); end_if; end_for;
    
  • PARI
    for(n=1, 2*10^11, m=n; s=0; while(m>0, s=s+prime(m)^2; m--); if(s%n==0, print1(n, ", "))) \\ Felix Fröhlich, Jul 07 2014
    
  • PARI
    isok(n) = norml2(primes(n)) % n == 0; \\ Michel Marcus, Nov 25 2020

Extensions

a(8)-a(9) from Robert G. Wilson v, Nov 15 2005
a(10)-a(11) from Ryan Propper, Mar 27 2007
a(12) from Robert Price, Mar 19 2013
a(13) from Balázs Dura-Kovács, Nov 25 2020
a(14) from Balázs Dura-Kovács, Nov 30 2020
a(15) from Anders Kaseorg, Dec 02 2020
a(16) from Jonas Lippuner, Aug 23 2021

A001644 a(n) = a(n-1) + a(n-2) + a(n-3), a(0)=3, a(1)=1, a(2)=3.

Original entry on oeis.org

3, 1, 3, 7, 11, 21, 39, 71, 131, 241, 443, 815, 1499, 2757, 5071, 9327, 17155, 31553, 58035, 106743, 196331, 361109, 664183, 1221623, 2246915, 4132721, 7601259, 13980895, 25714875, 47297029, 86992799, 160004703, 294294531, 541292033, 995591267, 1831177831
Offset: 0

Views

Author

Keywords

Comments

For n >= 3, a(n) is the number of cyclic sequences consisting of n zeros and ones that do not contain three consecutive ones provided the positions of the zeros and ones are fixed on a circle. This is proved in Charalambides (1991) and Zhang and Hadjicostas (2015). For example, a(3)=7 because only the sequences 110, 101, 011, 001, 010, 100 and 000 avoid three consecutive ones. (For n=1,2 the statement is still true provided we allow the sequence to wrap around itself on a circle.) - Petros Hadjicostas, Dec 16 2016
For n >= 3, also the number of dominating sets on the n-cycle graph C_n. - Eric W. Weisstein, Mar 30 2017
For n >= 3, also the number of minimal dominating sets and maximal irredundant sets on the n-sun graph. - Eric W. Weisstein, Jul 28 and Aug 17 2017
For n >= 3, also the number of minimal edge covers in the n-web graph. - Eric W. Weisstein, Aug 03 2017
For n >= 1, also the number of ways to tile a bracelet of length n with squares, dominoes, and trominoes. - Ruijia Li and Greg Dresden, Sep 14 2019
If n is prime, then a(n)-1 is a multiple of n ; a counterexample for the converse is given by n = 182. - Robert FERREOL, Apr 03 2024

Examples

			G.f. = 3 + x + 3*x^2 + 7*x^3 + 11*x^4 + 21*x^5 + 39*x^6 + 71*x^7 + 131*x^8 + ...
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 500.
  • G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.
  • 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

Cf. A000073, A073145, A106293 (Pisano periods), A073728 (partial sums).
Cf. A058265.

Programs

  • GAP
    a:=[3,1,3];; for n in [4..40] do a[n]:=a[n-1]+a[n-2]+a[n-3]; od; a; # Muniru A Asiru, Dec 18 2018
    
  • Haskell
    a001644 n = a001644_list !! n
    a001644_list = 3 : 1 : 3 : zipWith3 (((+) .) . (+))
                   a001644_list (tail a001644_list) (drop 2 a001644_list)
    -- Reinhard Zumkeller, Apr 13 2014
    
  • Magma
    I:=[3,1,3]; [n le 3 select I[n] else Self(n-1)+Self(n-2)+ Self(n-3): n in [1..40]]; // Vincenzo Librandi, Aug 04 2017
    
  • Maple
    A001644:=-(1+2*z+3*z**2)/(z**3+z**2+z-1); # Simon Plouffe in his 1992 dissertation; gives sequence except for the initial 3
    A001644 :=proc(n)
        option remember;
        if n <= 2 then
            1+2*modp(n+1,2)
        else
            procname(n-1)+procname(n-2)+procname(n-3);
        end if;
    end proc:
    seq(A001644(n),n=0..80) ;
  • Mathematica
    a[x_]:= a[x] = a[x-1] +a[x-2] +a[x-3]; a[0] = 3; a[1] = 1; a[2] = 3; Array[a, 40, 0]
    a[n_]:= n*Sum[Sum[Binomial[j, n-3*k+2*j]*Binomial[k, j], {j,n-3*k,k}]/k, {k, n}]; a[0] = 3; Array[a, 40, 0] (* Robert G. Wilson v, Feb 24 2011 *)
    LinearRecurrence[{1, 1, 1}, {3, 1, 3}, 40] (* Vladimir Joseph Stephan Orlovsky, Feb 08 2012 *)
    Table[RootSum[-1 - # - #^2 + #^3 &, #^n &], {n, 0, 40}] (* Eric W. Weisstein, Mar 30 2017 *)
    RootSum[-1 - # - #^2 + #^3 &, #^Range[0, 40] &] (* Eric W. Weisstein, Aug 17 2017 *)
  • PARI
    {a(n) = if( n<0, polsym(1 - x - x^2 - x^3, -n)[-n+1], polsym(1 + x + x^2 - x^3, n)[n+1])}; /* Michael Somos, Nov 02 2002 */
    
  • PARI
    my(x='x+O('x^40)); Vec((3-2*x-x^2)/(1-x-x^2-x^3)) \\ Altug Alkan, Apr 19 2018
    
  • SageMath
    ((3-2*x-x^2)/(1-x-x^2-x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Mar 22 2019

Formula

Binet's formula: a(n) = r1^n + r2^n + r3^n, where r1, r2, r3 are the roots of the characteristic polynomial 1 + x + x^2 - x^3, see A058265.
a(n) = A000073(n) + 2*A000073(n-1) + 3*A000073(n-2).
G.f.: (3-2*x-x^2)/(1-x-x^2-x^3). - Miklos Kristof, Jul 29 2002
a(n) = n*Sum_{k=1..n} Sum_{j=n-3*k..k} binomial(j, n-3*k+2*j)*binomial(k,j)/k, n > 0, a(0)=3. - Vladimir Kruchinin, Feb 24 2011
a(n) = a(n-1) + a(n-2) + a(n-3), a(0)=3, a(1)=1, a(2)=3. - Harvey P. Dale, Feb 01 2015
a(n) = A073145(-n). for all n in Z. - Michael Somos, Dec 17 2016
Sum_{k=0..n} k*a(k) = (n*a(n+3) - a(n+2) - (n+1)*a(n+1) + 4)/2. - Yichen Wang, Aug 30 2020
a(n) = Trace(M^n), where M = [0, 0, 1; 1, 0, 1; 0, 1, 1] is the companion matrix to the monic polynomial x^3 - x^2 - x - 1. It follows that the sequence satisfies the Gauss congruences: a(n*p^r) == a(n*p^(r-1)) (mod p^r) for positive integers n and r and all primes p. See Zarelua. - Peter Bala, Dec 29 2022

Extensions

Edited by Mario Catalani (mario.catalani(AT)unito.it), Jul 17 2002
Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021
Showing 1-10 of 141 results. Next