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

A001358 Semiprimes (or biprimes): products of two primes.

Original entry on oeis.org

4, 6, 9, 10, 14, 15, 21, 22, 25, 26, 33, 34, 35, 38, 39, 46, 49, 51, 55, 57, 58, 62, 65, 69, 74, 77, 82, 85, 86, 87, 91, 93, 94, 95, 106, 111, 115, 118, 119, 121, 122, 123, 129, 133, 134, 141, 142, 143, 145, 146, 155, 158, 159, 161, 166, 169, 177, 178, 183, 185, 187
Offset: 1

Views

Author

Keywords

Comments

Numbers of the form p*q where p and q are primes, not necessarily distinct.
These numbers are sometimes called semiprimes or 2-almost primes.
Numbers n such that Omega(n) = 2 where Omega(n) = A001222(n) is the sum of the exponents in the prime decomposition of n.
Complement of A100959; A064911(a(n)) = 1. - Reinhard Zumkeller, Nov 22 2004
The graph of this sequence appears to be a straight line with slope 4. However, the asymptotic formula shows that the linearity is an illusion and in fact a(n)/n ~ log(n)/log(log(n)) goes to infinity. See also the graph of A066265 = number of semiprimes < 10^n.
For numbers between 33 and 15495, semiprimes are more plentiful than any other k-almost prime. See A125149.
Numbers that are divisible by exactly 2 prime powers (not including 1). - Jason Kimberley, Oct 02 2011
The (disjoint) union of A006881 and A001248. - Jason Kimberley, Nov 11 2015
An equivalent definition of this sequence is a'(n) = smallest composite number which is not divided by any smaller composite number a'(1),...,a'(n-1). - Meir-Simchah Panzer, Jun 22 2016
The above characterization can be simplified to "Composite numbers not divisible by a smaller term." This shows that this is the equivalent of primes computed via Eratosthenes's sieve, but starting with the set of composite numbers (i.e., complement of 1 union primes) instead of all positive integers > 1. It's easy to see that iterating the method (using Eratosthenes's sieve each time on the remaining numbers, complement of the previously computed set) yields numbers with bigomega = k for k = 0, 1, 2, 3, ..., i.e., {1}, A000040, this, A014612, etc. - M. F. Hasler, Apr 24 2019
For all n except n = 2, a(n) is a deficient number. - Amrit Awasthi, Sep 10 2024
It is reasonable to assume that the "comforting numbers" which John T. Williams found in Chapter 3 of Milne's book "The House at Pooh Corner" are these semiprimes. Winnie-the-Pooh wonders whether he has 14 or 15 honey pots and concludes: "It's sort of comforting." To arrange a semiprime number of honey pots in a rectangular way, let's say on a shelf, with the larger divisor parallel to the wall, there is only one solution and this is for a simple mind like Winnie-the-Pooh comforting. - Ruediger Jehn, Dec 12 2024

Examples

			From _Gus Wiseman_, May 27 2021: (Start)
The sequence of terms together with their prime factors begins:
   4 = 2*2     46 = 2*23     91 = 7*13    141 = 3*47
   6 = 2*3     49 = 7*7      93 = 3*31    142 = 2*71
   9 = 3*3     51 = 3*17     94 = 2*47    143 = 11*13
  10 = 2*5     55 = 5*11     95 = 5*19    145 = 5*29
  14 = 2*7     57 = 3*19    106 = 2*53    146 = 2*73
  15 = 3*5     58 = 2*29    111 = 3*37    155 = 5*31
  21 = 3*7     62 = 2*31    115 = 5*23    158 = 2*79
  22 = 2*11    65 = 5*13    118 = 2*59    159 = 3*53
  25 = 5*5     69 = 3*23    119 = 7*17    161 = 7*23
  26 = 2*13    74 = 2*37    121 = 11*11   166 = 2*83
  33 = 3*11    77 = 7*11    122 = 2*61    169 = 13*13
  34 = 2*17    82 = 2*41    123 = 3*41    177 = 3*59
  35 = 5*7     85 = 5*17    129 = 3*43    178 = 2*89
  38 = 2*19    86 = 2*43    133 = 7*19    183 = 3*61
  39 = 3*13    87 = 3*29    134 = 2*67    185 = 5*37
(End)
		

References

  • Archimedeans Problems Drive, Eureka, 17 (1954), 8.
  • Raymond Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; Chapter II, Problem 60.
  • Edmund Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Vol. 1, Teubner, Leipzig; third edition: Chelsea, New York (1974). See p. 211.
  • 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).
  • John T. Williams, Pooh and the Philosophers, Dutton Books, 1995.

Crossrefs

Cf. A064911 (characteristic function).
Cf. A048623, A048639, A000040 (primes), A014612 (products of 3 primes), A014613, A014614, A072000 ("pi" for semiprimes), A065516 (first differences).
Sequences listing r-almost primes, that is, the n such that A001222(n) = r: A000040 (r=1), this sequence (r=2), A014612 (r=3), A014613 (r=4), A014614 (r=5), A046306 (r=6), A046308 (r=7), A046310 (r=8), A046312 (r=9), A046314 (r=10), A069272 (r=11), A069273 (r=12), A069274 (r=13), A069275 (r=14), A069276 (r=15), A069277 (r=16), A069278 (r=17), A069279 (r=18), A069280 (r=19), A069281 (r=20).
These are the Heinz numbers of length-2 partitions, counted by A004526.
The squarefree case is A006881 with odd/even terms A046388/A100484 (except 4).
Including primes gives A037143.
The odd/even terms are A046315/A100484.
Partial sums are A062198.
The prime factors are A084126/A084127.
Grouping by greater factor gives A087112.
The product/sum/difference of prime indices is A087794/A176504/A176506.
Positions of even/odd terms are A115392/A289182.
The terms with relatively prime/divisible prime indices are A300912/A318990.
Factorizations using these terms are counted by A320655.
The prime indices are A338898/A338912/A338913.
Grouping by weight (sum of prime indices) gives A338904, with row sums A024697.
The terms with even/odd weight are A338906/A338907.
The terms with odd/even prime indices are A338910/A338911.
The least/greatest term of weight n is A339114/A339115.

Programs

  • Haskell
    a001358 n = a001358_list !! (n-1)
    a001358_list = filter ((== 2) . a001222) [1..]
    
  • Magma
    [n: n in [2..200] | &+[d[2]: d in Factorization(n)] eq 2]; // Bruno Berselli, Sep 09 2015
    
  • Maple
    A001358 := proc(n) option remember; local a; if n = 1 then 4; else for a from procname(n-1)+1 do if numtheory[bigomega](a) = 2 then return a; end if; end do: end if; end proc:
    seq(A001358(n), n=1..120) ; # R. J. Mathar, Aug 12 2010
  • Mathematica
    Select[Range[200], Plus@@Last/@FactorInteger[#] == 2 &] (* Zak Seidov, Jun 14 2005 *)
    Select[Range[200], PrimeOmega[#]==2&] (* Harvey P. Dale, Jul 17 2011 *)
  • PARI
    select( isA001358(n)={bigomega(n)==2}, [1..199]) \\ M. F. Hasler, Apr 09 2008; added select() Apr 24 2019
    
  • PARI
    list(lim)=my(v=List(),t);forprime(p=2, sqrt(lim), t=p;forprime(q=p, lim\t, listput(v,t*q))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Sep 11 2011
    
  • PARI
    A1358=List(4); A001358(n)={while(#A1358M. F. Hasler, Apr 24 2019
    
  • Python
    from sympy import factorint
    def ok(n): return sum(factorint(n).values()) == 2
    print([k for k in range(1, 190) if ok(k)]) # Michael S. Branicky, Apr 30 2022
    
  • Python
    from math import isqrt
    from sympy import primepi, prime
    def A001358(n):
        def f(x): return int(n+x-sum(primepi(x//prime(k))-k+1 for k in range(1, primepi(isqrt(x))+1)))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Jul 23 2024

Formula

a(n) ~ n*log(n)/log(log(n)) as n -> infinity [Landau, p. 211], [Ayoub].
Recurrence: a(1) = 4; for n > 1, a(n) = smallest composite number which is not a multiple of any of the previous terms. - Amarnath Murthy, Nov 10 2002
A174956(a(n)) = n. - Reinhard Zumkeller, Apr 03 2010
a(n) = A088707(n) - 1. - Reinhard Zumkeller, Feb 20 2012
Sum_{n>=1} 1/a(n)^s = (1/2)*(P(s)^2 + P(2*s)), where P is the prime zeta function. - Enrique Pérez Herrero, Jun 24 2012
sigma(a(n)) + phi(a(n)) - mu(a(n)) = 2*a(n) + 1. mu(a(n)) = ceiling(sqrt(a(n))) - floor(sqrt(a(n))). - Wesley Ivan Hurt, May 21 2013
mu(a(n)) = -Omega(a(n)) + omega(a(n)) + 1, where mu is the Moebius function (A008683), Omega is the count of prime factors with repetition, and omega is the count of distinct prime factors. - Alonso del Arte, May 09 2014
a(n) = A078840(2,n). - R. J. Mathar, Jan 30 2019
A100484 UNION A046315. - R. J. Mathar, Apr 19 2023
Conjecture: a(n)/n ~ (log(n)/log(log(n)))*(1-(M/log(log(n)))) as n -> oo, where M is the Mertens's constant (A077761). - Alain Rocchelli, Feb 02 2025

Extensions

More terms from James Sellers, Aug 22 2000

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

A001065 Sum of proper divisors (or aliquot parts) of n: sum of divisors of n that are less than n.

Original entry on oeis.org

0, 1, 1, 3, 1, 6, 1, 7, 4, 8, 1, 16, 1, 10, 9, 15, 1, 21, 1, 22, 11, 14, 1, 36, 6, 16, 13, 28, 1, 42, 1, 31, 15, 20, 13, 55, 1, 22, 17, 50, 1, 54, 1, 40, 33, 26, 1, 76, 8, 43, 21, 46, 1, 66, 17, 64, 23, 32, 1, 108, 1, 34, 41, 63, 19, 78, 1, 58, 27, 74, 1, 123, 1, 40, 49, 64, 19, 90, 1, 106
Offset: 1

Views

Author

Keywords

Comments

Also total number of parts in all partitions of n into equal parts that do not contain 1 as a part. - Omar E. Pol, Jan 16 2013
Related concepts: If a(n) < n, n is said to be deficient, if a(n) > n, n is abundant, and if a(n) = n, n is perfect. If there is a cycle of length 2, so that a(n) = b and a(b) = n, b and n are said to be amicable. If there is a longer cycle, the numbers in the cycle are said to be sociable. See examples. - Juhani Heino, Jul 17 2017
Sum of the smallest parts in the partitions of n into two parts such that the smallest part divides the largest. - Wesley Ivan Hurt, Dec 22 2017
a(n) is also the total number of parts congruent to 0 mod k in the partitions of k*n into equal parts that do not contain k as a part (the comment dated Jan 16 2013 is the case for k = 1). - Omar E. Pol, Nov 23 2019
Fixed points are in A000396. - Alois P. Heinz, Mar 10 2024

Examples

			x^2 + x^3 + 3*x^4 + x^5 + 6*x^6 + x^7 + 7*x^8 + 4*x^9 + 8*x^10 + x^11 + ...
For n = 44, sum of divisors of n = sigma(n) = 84; so a(44) = 84-44 = 40.
Related concepts: (Start)
From 1 to 17, all n are deficient, except 6 and 12 seen below. See A005100.
Abundant numbers: a(12) = 16, a(18) = 21. See A005101.
Perfect numbers: a(6) = 6, a(28) = 28. See A000396.
Amicable numbers: a(220) = 284, a(284) = 220. See A259180.
Sociable numbers: 12496 -> 14288 -> 15472 -> 14536 -> 14264 -> 12496. See A122726. (End)
For n = 10 the sum of the divisors of 10 that are less than 10 is 1 + 2 + 5 = 8. On the other hand, the partitions of 10 into equal parts that do not contain 1 as a part are [10], [5,5], [2,2,2,2,2], there are 8 parts, so a(10) = 8. - _Omar E. Pol_, Nov 24 2019
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 840.
  • George E. Andrews, Number Theory. New York: Dover, 1994; Pages 1, 75-92; p. 92 #15: Sigma(n) / d(n) >= n^(1/2).
  • Carl Pomerance, The first function and its iterates, pp. 125-138 in Connections in Discrete Mathematics, ed. S. Butler et al., Cambridge, 2018.
  • H. J. J. te Riele, Perfect numbers and aliquot sequences, pp. 77-94 in J. van de Lune, ed., Studieweek "Getaltheorie en Computers", published by Math. Centrum, Amsterdam, Sept. 1980.
  • 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 91.

Crossrefs

Least inverse: A070015, A359132.
Values taken: A078923, values not taken: A005114.
Records: A034090, A034091.
First differences: A053246, partial sums: A153485.
a(n) = n - A033879(n) = n + A033880(n). - Omar E. Pol, Dec 30 2013
Row sums of A141846 and of A176891. - Gary W. Adamson, May 02 2010
Row sums of A176079. - Mats Granvik, May 20 2012
Alternating row sums of A231347. - Omar E. Pol, Jan 02 2014
a(n) = sum (A027751(n,k): k = 1..A000005(n)-1). - Reinhard Zumkeller, Apr 05 2013
For n > 1: a(n) = A240698(n,A000005(n)-1). - Reinhard Zumkeller, Apr 10 2014
A134675(n) = A007434(n) + a(n). - Conjectured by John Mason and proved by Max Alekseyev, Jan 07 2015
Cf. A037020 (primes), A053868, A053869 (odd and even terms).
Cf. A048138 (number of occurrences), A238895, A238896 (record values thereof).
Cf. A007956 (products of proper divisors).
Cf. A005100, A005101, A000396, A259180, A122726 (related concepts).

Programs

  • Haskell
    a001065 n = a000203 n - n  -- Reinhard Zumkeller, Sep 15 2011
    
  • Magma
    [SumOfDivisors(n)-n: n in [1..100]]; // Vincenzo Librandi, May 06 2015
    
  • Maple
    A001065 := proc(n)
        numtheory[sigma](n)-n ;
    end proc:
    seq( A001065(n),n=1..100) ;
  • Mathematica
    Table[ Plus @@ Select[ Divisors[ n ], #Zak Seidov, Sep 10 2009 *)
    Table[DivisorSigma[1, n] - n, {n, 1, 80}] (* Jean-François Alcover, Apr 25 2013 *)
    Array[Plus @@ Most@ Divisors@# &, 80] (* Robert G. Wilson v, Dec 24 2017 *)
  • MuPAD
    numlib::sigma(n)-n$ n=1..81 // Zerinvary Lajos, May 13 2008
    
  • PARI
    {a(n) = if( n==0, 0, sigma(n) - n)} /* Michael Somos, Sep 20 2011 */
    
  • Python
    from sympy import divisor_sigma
    def A001065(n): return divisor_sigma(n)-n # Chai Wah Wu, Nov 04 2022
    
  • Sage
    [sigma(n, 1)-n for n in range(1, 81)] # Stefano Spezia, Jul 14 2025

Formula

G.f.: Sum_{k>0} k * x^(2*k)/(1 - x^k). - Michael Somos, Jul 05 2006
a(n) = sigma(n) - n = A000203(n) - n. - Lekraj Beedassy, Jun 02 2005
a(n) = A155085(-n). - Michael Somos, Sep 20 2011
Equals inverse Mobius transform of A051953 = A051731 * A051953. Example: a(6) = 6 = (1, 1, 1, 0, 0, 1) dot (0, 1, 1, 2, 1, 4) = (0 + 1 + 1 + 0 + 0 + 4), where A051953 = (0, 1, 1, 2, 1, 4, 1, 4, 3, 6, 1, 8, ...) and (1, 1, 1, 0, 0, 1) = row 6 of A051731 where the 1's positions indicate the factors of 6. - Gary W. Adamson, Jul 11 2008
a(n) = A006128(n) - A220477(n) - n. - Omar E. Pol Jan 17 2013
a(n) = Sum_{i=1..floor(n/2)} i*(1-ceiling(frac(n/i))). - Wesley Ivan Hurt, Oct 25 2013
Dirichlet g.f.: zeta(s-1)*(zeta(s) - 1). - Ilya Gutkovskiy, Aug 07 2016
a(n) = 1 + A048050(n), n > 1. - R. J. Mathar, Mar 13 2018
Erdős (Elem. Math. 28 (1973), 83-86) shows that the density of even integers in the range of a(n) is strictly less than 1/2. The argument of Coppersmith (1987) shows that the range of a(n) has density at most 47/48 < 1. - N. J. A. Sloane, Dec 21 2019
G.f.: Sum_{k >= 2} x^k/(1 - x^k)^2. Cf. A296955. (This follows from the fact that if g(z) = Sum_{n >= 1} a(n)*z^n and f(z) = Sum_{n >= 1} a(n)*z^(N*n)/(1 - z^n) then f(z) = Sum_{k >= N} g(z^k), taking a(n) = n and N = 2.) - Peter Bala, Jan 13 2021
Faster converging g.f.: Sum_{n >= 1} q^(n*(n+1))*(n*q^(3*n+2) - (n + 1)*q^(2*n+1) - (n - 1)*q^(n+1) + n)/((1 - q^n)*(1 - q^(n+1))^2). (In equation 1 in Arndt, after combining the two n = 0 summands to get -t/(1 - t), apply the operator t*d/dt to the resulting equation and then set t = q and x = 1.) - Peter Bala, Jan 22 2021
a(n) = Sum_{d|n} d * (1 - [n = d]), where [ ] is the Iverson bracket. - Wesley Ivan Hurt, Jan 28 2021
a(n) = Sum_{i=1..n} ((n-1) mod i) - (n mod i). [See also A176079.] - José de Jesús Camacho Medina, Feb 23 2021

A001157 a(n) = sigma_2(n): sum of squares of divisors of n.

Original entry on oeis.org

1, 5, 10, 21, 26, 50, 50, 85, 91, 130, 122, 210, 170, 250, 260, 341, 290, 455, 362, 546, 500, 610, 530, 850, 651, 850, 820, 1050, 842, 1300, 962, 1365, 1220, 1450, 1300, 1911, 1370, 1810, 1700, 2210, 1682, 2500, 1850, 2562, 2366, 2650, 2210, 3410, 2451, 3255
Offset: 1

Views

Author

Keywords

Comments

If the canonical factorization of n into prime powers is the product of p^e(p) then sigma_k(n) = Product_p ((p^((e(p)+1)*k))-1)/(p^k-1).
sigma_2(n) is the sum of the squares of the divisors of n.
Sum_{d|n} 1/d^k is equal to sigma_k(n)/n^k. So sequences A017665-A017712 also give the numerators and denominators of sigma_k(n)/n^k for k = 1..24. The power sums sigma_k(n) are in sequences A000203 (k=1), A001157-A001160 (k=2,3,4,5), A013954-A013972 for k = 6,7,...,24. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 05 2001.
Row sums of triangles A134575 and A134559. - Gary W. Adamson, Nov 02 2007
Also sum of square divisors of n^2. - Michel Marcus, Jan 14 2014
Conjecture: For each k = 2,3,..., all the rational numbers sigma_k(n)/n^k = Sum_{d|n} 1/d^k (n = 1,2,3,...) have pairwise distinct fractional parts. - Zhi-Wei Sun, Oct 15 2015
5 is the only prime entry in the sequence. - Drake Thomas, Dec 18 2016
4*a(n) = sum of squares of even divisors of 2*n. - Wolfdieter Lang, Jan 07 2017

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 827.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 38.
  • D. M. Bressoud, Proofs and Confirmations, Camb. Univ. Press, 1999; p. 11.
  • P. A. MacMahon, The connexion between the sum of the squares of the divisors and the number of partitions of a given number, Messenger Math., 54 (1924), 113-116. Collected Papers, MIT Press, 1978, Vol. I, pp. 1364-1367. See Table I. The entry 53 should be 50. - N. J. A. Sloane, May 21 2014
  • 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. also A192794, A082063 (gcd(a(n),n) and its largest prime factor); A179931, A192795 (gcd(a(n),A000203(n)) and largest prime factor).
Main diagonal of the array in A242639.
Cf. A333972 (Dgf at s=4).

Programs

  • Haskell
    a001157 n = s n 1 1 a000040_list where
       s 1 1 y _          = y
       s m x y ps'@(p:ps)
         | m `mod` p == 0 = s (m `div` p) (x * p^2) y ps'
         | x > 1          = s m 1 (y * (x * p^2 - 1) `div` (p^2 - 1)) ps
         | otherwise      = s m 1 y ps
    -- Reinhard Zumkeller, Jul 10 2011
    
  • Magma
    [DivisorSigma(2,n): n in [1..50]]; // Bruno Berselli, Apr 10 2013
    
  • Maple
    with(numtheory); A001157 := n->sigma[2](n); [seq(sigma[2](n), n=1..100)];
  • Mathematica
    Table[DivisorSigma[2, n], {n, 1, 50}] (* Stefan Steinerberger, Mar 24 2006 *)
    DivisorSigma[2,Range[50]] (* Harvey P. Dale, Aug 22 2016 *)
  • Maxima
    makelist(divsum(n,2),n,1,20); /* Emanuele Munarini, Mar 26 2011 */
    
  • PARI
    a(n)=if(n<1,0,sigma(n,2))
    
  • PARI
    a(n)=if(n<1,0,direuler(p=2,n,1/(1-X)/(1-p^2*X))[n])
    
  • PARI
    a(n)=if(n<1,0,n*polcoeff(sum(k=1,n,x^k/(x^k-1)^2/k,x*O(x^n)),n)) /* Michael Somos, Jan 29 2005 */
    
  • PARI
    N=99; q='q+O('q^N); Vec(sum(n=1,N,n^2*q^n/(1-q^n)))  /* Joerg Arndt, Feb 04 2011 */
    
  • PARI
    a(n) = sumdiv(n^2, d, issquare(d)*d); \\ Michel Marcus, Jan 14 2014
    
  • Python
    from sympy import divisor_sigma
    def a(n): return divisor_sigma(n, 2)
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Jan 05 2021
    
  • Python
    from math import prod
    from sympy import factorint
    def a(n): return prod((p**(2*e+2)-1)//(p**2-1) for p, e in factorint(n).items())
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Feb 25 2024
  • Sage
    [sigma(n,2)for n in range(1,51)] # Zerinvary Lajos, Jun 04 2009
    

Formula

G.f.: Sum_{k>0} k^2 x^k/(1-x^k). Dirichlet g.f.: zeta(s)*zeta(s-2). - Michael Somos, Apr 05 2003
Multiplicative with a(p^e) = (p^(2e+2)-1)/(p^2-1). - David W. Wilson, Aug 01 2001
G.f. for sigma_k(n): Sum_{m>0} m^k*x^m/(1-x^m). - Vladeta Jovovic, Oct 18 2002
L.g.f.: -log(Product_{j>=1} (1-x^j)^j) = Sum_{n>=1} a(n)/n*x^n. - Joerg Arndt, Feb 04 2011
Equals A127093 * [1, 2, 3, ...]. - Gary W. Adamson, May 10 2007
Equals A051731 * [1, 4, 9, 16, 25, ...]. A051731 * [1/1, 1/2, 1/3, 1/4, ...] = [1/1, 5/4, 10/9, 21/16, 26/25, ...]. - Gary W. Adamson, Nov 02 2007
Row sums of triangle A134841. - Gary W. Adamson, Nov 12 2007
a(n) = A035316(n^2). - Michel Marcus, Jan 14 2014
Conjecture: a(n) = sigma(n^2*rad(n))/sigma(rad(n)), where sigma = A000203 and rad = A007947. - Velin Yanev, Aug 20 2017
G.f.: Sum_{k>=1} x^k*(1 + x^k)/(1 - x^k)^3. - Ilya Gutkovskiy, Oct 24 2018
a(n) = a(n/4) + A050461(n) + A076577(n/2) + A050465(n) where A(.) are zero for non-integer arguments. - R. J. Mathar, May 25 2020
Sum_{k>=1} 1/a(k) = A109694 = 1.53781289182725616253866100273826833091936004947322354929617689659426330445... - Vaclav Kotesovec, Sep 26 2020
G.f.: Sum_{n >= 1} q^(n^2)*(n^2 - ((n-1)^2 - 2)*q^n - ((n+1)^2 - 2)*q^(2*n) + n^2*q^(3*n))/(1 - q^n)^3 - apply the operator x*d/dx twice to equation 5 in Arndt and set x = 1. - Peter Bala, Jan 21 2021
From Vaclav Kotesovec, Aug 07 2022: (Start)
Sum_{k=1..n} a(k) = A064602(n) ~ zeta(3) * n^3 / 3.
Sum_{k=1..n} (-1)^k * a(k) ~ zeta(3) * n^3 / 24. (End)
a(n) = Sum_{1 <= i, j <= n} tau(gcd(i, j, n)) = Sum_{d divides n} tau(d) * J_2(n/d), where the divisor function tau(n) = A000005(n) and the Jordan totient function J_2(n) = A007434(n). - Peter Bala, Jan 22 2024

A014574 Average of twin prime pairs.

Original entry on oeis.org

4, 6, 12, 18, 30, 42, 60, 72, 102, 108, 138, 150, 180, 192, 198, 228, 240, 270, 282, 312, 348, 420, 432, 462, 522, 570, 600, 618, 642, 660, 810, 822, 828, 858, 882, 1020, 1032, 1050, 1062, 1092, 1152, 1230, 1278, 1290, 1302, 1320, 1428, 1452, 1482, 1488, 1608
Offset: 1

Views

Author

Keywords

Comments

With an initial 1 added, this is the complement of the closure of {2} under a*b+1 and a*b-1. - Franklin T. Adams-Watters, Jan 11 2006
Also the square root of the product of twin prime pairs + 1. Two consecutive odd numbers can be written as 2k+1,2k+3. Then (2k+1)(2k+3)+1 = 4(k^2+2k+1) = 4(k+1)^2, a perfect square. Since twin prime pairs are two consecutive odd numbers, the statement is true for all twin prime pairs. - Cino Hilliard, May 03 2006
Or, single (or isolated) composites. Nonprimes k such that neither k-1 nor k+1 is nonprime. - Juri-Stepan Gerasimov, Aug 11 2009
Numbers n such that sigma(n-1) = phi(n+1). - Farideh Firoozbakht, Jul 04 2010
Aside from the first term in the sequence, all remaining terms have digital root 3, 6, or 9. - J. W. Helkenberg, Jul 24 2013
Numbers n such that n^2-1 is a semiprime. - Thomas Ordowski, Sep 24 2015
Every term but the first is a multiple of 6. - Harvey P. Dale, Mar 31 2023

References

  • Archimedeans Problems Drive, Eureka, 30 (1967).

Crossrefs

A068507 is the intersection of A002182 and this sequence.

Programs

  • GAP
    a:=1+Filtered([1..2000],p->IsPrime(p) and IsPrime(p+2)); # Muniru A Asiru, May 20 2018
  • Haskell
    a014574 n = a014574_list !! (n-1)
    a014574_list = [x | x <- [2,4..], a010051 (x-1) == 1, a010051 (x+1) == 1]
    -- Reinhard Zumkeller, Apr 11 2012
    
  • Maple
    P := select(isprime,[$1..1609]): map(p->p+1,select(p->member(p+2,P),P)); # Peter Luschny, Mar 03 2011
    A014574 := proc(n) option remember; local p ; if n = 1 then 4 ; else p := nextprime( procname(n-1) ) ; while not isprime(p+2) do p := nextprime(p) ; od ; return p+1 ; end if ; end proc: # R. J. Mathar, Jun 11 2011
  • Mathematica
    Select[Table[Prime[n] + 1, {n, 260}], PrimeQ[ # + 1] &] (* Ray Chandler, Oct 12 2005 *)
    Mean/@Select[Partition[Prime[Range[300]],2,1],Last[#]-First[#]==2&] (* Harvey P. Dale, Jan 16 2014 *)
  • Maxima
    A014574(n) := block(
        if n = 1 then
            return(4),
        p : A014574(n-1) ,
        for k : 2 step 2 do (
            if primep(p+k-1) and primep(p+k+1) then
                return(p+k)
        )
    )$ /* R. J. Mathar, Mar 15 2012 */
    
  • PARI
    p=2;forprime(q=3,1e4,if(q-p==2,print1(p+1", "));p=q) \\ Charles R Greathouse IV, Jun 10 2011
    

Formula

a(n) = (A001359(n) + A006512(n))/2 = 2*A040040(n) = A054735(n)/2 = A111046(n)/4.
a(n) = A129297(n+4). - Reinhard Zumkeller, Apr 09 2007
A010051(a(n) - 1) * A010051(a(n) + 1) = 1. Reinhard Zumkeller, Apr 11 2012
a(n) = 6*A002822(n-1), n>=2. - Ivan N. Ianakiev, Aug 19 2013
a(n)^4 - 4*a(n)^2 = A062354(a(n)^2 - 1). - Raphie Frank, Oct 17 2013

Extensions

Offset changed to 1 by R. J. Mathar, Jun 11 2011

A001333 Pell-Lucas numbers: numerators of continued fraction convergents to sqrt(2).

Original entry on oeis.org

1, 1, 3, 7, 17, 41, 99, 239, 577, 1393, 3363, 8119, 19601, 47321, 114243, 275807, 665857, 1607521, 3880899, 9369319, 22619537, 54608393, 131836323, 318281039, 768398401, 1855077841, 4478554083, 10812186007, 26102926097, 63018038201, 152139002499, 367296043199
Offset: 0

Views

Author

Keywords

Comments

Number of n-step non-selfintersecting paths starting at (0,0) with steps of types (1,0), (-1,0) or (0,1) [Stanley].
Number of n steps one-sided prudent walks with east, west and north steps. - Shanzhen Gao, Apr 26 2011
Number of ternary strings of length n-1 with subwords (0,2) and (2,0) not allowed. - Olivier Gérard, Aug 28 2012
Number of symmetric 2n X 2 or (2n-1) X 2 crossword puzzle grids: all white squares are edge connected; at least 1 white square on every edge of grid; 180-degree rotational symmetry. - Erich Friedman
a(n+1) is the number of ways to put molecules on a 2 X n ladder lattice so that the molecules do not touch each other.
In other words, a(n+1) is the number of independent vertex sets and vertex covers in the n-ladder graph P_2 X P_n. - Eric W. Weisstein, Apr 04 2017
Number of (n-1) X 2 binary arrays with a path of adjacent 1's from top row to bottom row, see A359576. - R. H. Hardin, Mar 16 2002
a(2*n+1) with b(2*n+1) := A000129(2*n+1), n >= 0, give all (positive integer) solutions to Pell equation a^2 - 2*b^2 = -1.
a(2*n) with b(2*n) := A000129(2*n), n >= 1, give all (positive integer) solutions to Pell equation a^2 - 2*b^2 = +1 (see Emerson reference).
Bisection: a(2*n) = T(n,3) = A001541(n), n >= 0 and a(2*n+1) = S(2*n,2*sqrt(2)) = A002315(n), n >= 0, with T(n,x), resp. S(n,x), Chebyshev's polynomials of the first, resp. second kind. See A053120, resp. A049310.
Binomial transform of A077957. - Paul Barry, Feb 25 2003
For n > 0, the number of (s(0), s(1), ..., s(n)) such that 0 < s(i) < 4 and |s(i) - s(i-1)| <= 1 for i = 1,2,...,n, s(0) = 2, s(n) = 2. - Herbert Kociemba, Jun 02 2004
For n > 1, a(n) corresponds to the longer side of a near right-angled isosceles triangle, one of the equal sides being A000129(n). - Lekraj Beedassy, Aug 06 2004
Exponents of terms in the series F(x,1), where F is determined by the equation F(x,y) = xy + F(x^2*y,x). - Jonathan Sondow, Dec 18 2004
Number of n-words from the alphabet A={0,1,2} which two neighbors differ by at most 1. - Fung Cheok Yin (cheokyin_restart(AT)yahoo.com.hk), Aug 30 2006
Consider the mapping f(a/b) = (a + 2b)/(a + b). Taking a = b = 1 to start with and carrying out this mapping repeatedly on each new (reduced) rational number gives the following sequence 1/1, 3/2, 7/5, 17/12, 41/29, ... converging to 2^(1/2). Sequence contains the numerators. - Amarnath Murthy, Mar 22 2003 [Amended by Paul E. Black (paul.black(AT)nist.gov), Dec 18 2006]
Odd-indexed prime numerators are prime RMS numbers (A140480) and also NSW primes (A088165). - Ctibor O. Zizka, Aug 13 2008
The intermediate convergents to 2^(1/2) begin with 4/3, 10/7, 24/17, 58/41; essentially, numerators=A052542 and denominators here. - Clark Kimberling, Aug 26 2008
Equals right border of triangle A143966. Starting (1, 3, 7, ...) equals INVERT transform of (1, 2, 2, 2, ...) and row sums of triangle A143966. - Gary W. Adamson, Sep 06 2008
Inverse binomial transform of A006012; Hankel transform is := [1, 2, 0, 0, 0, 0, 0, 0, 0, ...]. - Philippe Deléham, Dec 04 2008
From Charlie Marion, Jan 07 2009: (Start)
In general, denominators, a(k,n) and numerators, b(k,n), of continued fraction convergents to sqrt((k+1)/k) may be found as follows:
let a(k,0) = 1, a(k,1) = 2k; for n>0, a(k,2n) = 2*a(k,2n-1) + a(k,2n-2) and a(k,2n+1) = (2k)*a(k,2n) + a(k,2n-1);
let b(k,0) = 1, b(k,1) = 2k+1; for n>0, b(k,2n) = 2*b(k,2n-1) + b(k,2n-2) and b(k,2n+1) = (2k)*b(k,2n) + b(k,2n-1).
For example, the convergents to sqrt(2/1) start 1/1, 3/2, 7/5, 17/12, 41/29.
In general, if a(k,n) and b(k,n) are the denominators and numerators, respectively, of continued fraction convergents to sqrt((k+1)/k) as defined above, then
k*a(k,2n)^2 - a(k,2n-1)*a(k,2n+1) = k = k*a(k,2n-2)*a(k,2n) - a(k,2n-1)^2 and
b(k,2n-1)*b(k,2n+1) - k*b(k,2n)^2 = k+1 = b(k,2n-1)^2 - k*b(k,2n-2)*b(k,2n);
for example, if k=1 and n=3, then b(1,n)=a(n+1) and
1*a(1,6)^2 - a(1,5)*a(1,7) = 1*169^2 - 70*408 = 1;
1*a(1,4)*a(1,6) - a(1,5)^2 = 1*29*169 - 70^2 = 1;
b(1,5)*b(1,7) - 1*b(1,6)^2 = 99*577 - 1*239^2 = 2;
b(1,5)^2 - 1*b(1,4)*b(1,6) = 99^2 - 1*41*239 = 2.
(End)
This sequence occurs in the lower bound of the order of the set of equivalent resistances of n equal resistors combined in series and in parallel (A048211). - Sameen Ahmed Khan, Jun 28 2010
Let M = a triangle with the Fibonacci series in each column, but the leftmost column is shifted upwards one row. A001333 = lim_{n->infinity} M^n, the left-shifted vector considered as a sequence. - Gary W. Adamson, Jul 27 2010
a(n) is the number of compositions of n when there are 1 type of 1 and 2 types of other natural numbers. - Milan Janjic, Aug 13 2010
Equals the INVERTi transform of A055099. - Gary W. Adamson, Aug 14 2010
From L. Edson Jeffery, Apr 04 2011: (Start)
Let U be the unit-primitive matrix (see [Jeffery])
U = U_(8,2) = (0 0 1 0)
(0 1 0 1)
(1 0 2 0)
(0 2 0 1).
Then a(n) = (1/4)*Trace(U^n). (See also A084130, A006012.)
(End)
For n >= 1, row sums of triangle
m/k.|..0.....1.....2.....3.....4.....5.....6.....7
==================================================
.0..|..1
.1..|..1.....2
.2..|..1.....2.....4
.3..|..1.....4.....4.....8
.4..|..1.....4....12.....8....16
.5..|..1.....6....12....32....16....32
.6..|..1.....6....24....32....80....32....64
.7..|..1.....8....24....80....80...192....64...128
which is the triangle for numbers 2^k*C(m,k) with duplicated diagonals. - Vladimir Shevelev, Apr 12 2012
a(n) is also the number of ways to place k non-attacking wazirs on a 2 X n board, summed over all k >= 0 (a wazir is a leaper [0,1]). - Vaclav Kotesovec, May 08 2012
The sequences a(n) and b(n) := A000129(n) are entries of powers of the special case of the Brahmagupta Matrix - for details see Suryanarayan's paper. Further, as Suryanarayan remark, if we set A = 2*(a(n) + b(n))*b(n), B = a(n)*(a(n) + 2*b(n)), C = a(n)^2 + 2*a(n)*b(n) + 2*b(n)^2 we obtain integral solutions of the Pythagorean relation A^2 + B^2 = C^2, where A and B are consecutive integers. - Roman Witula, Jul 28 2012
Pisano period lengths: 1, 1, 8, 4, 12, 8, 6, 4, 24, 12, 24, 8, 28, 6, 24, 8, 16, 24, 40, 12, .... - R. J. Mathar, Aug 10 2012
This sequence and A000129 give the diagonal numbers described by Theon of Smyrna. - Sture Sjöstedt, Oct 20 2012
a(n) is the top left entry of the n-th power of any of the following six 3 X 3 binary matrices: [1, 1, 1; 1, 1, 1; 1, 0, 0] or [1, 1, 1; 1, 1, 0; 1, 1, 0] or [1, 1, 1; 1, 0, 1; 1, 1, 0] or [1, 1, 1; 1, 1, 0; 1, 0, 1] or [1, 1, 1; 1, 0, 1; 1, 0, 1] or [1, 1, 1; 1, 0, 0; 1, 1, 1]. - R. J. Mathar, Feb 03 2014
If p is prime, a(p) == 1 (mod p) (compare with similar comment for A000032). - Creighton Dement, Oct 11 2005, modified by Davide Colazingari, Jun 26 2016
a(n) = A000129(n) + A000129(n-1), where A000129(n) is the n-th Pell Number; e.g., a(6) = 99 = A000129(6) + A000129(5) = 70 + 29. Hence the sequence of fractions has the form 1 + A000129(n-1)/A000129(n), and the ratio A000129(n-1)/A000129(n)converges to sqrt(2) - 1. - Gregory L. Simay, Nov 30 2018
For n > 0, a(n+1) is the length of tau^n(1) where tau is the morphism: 1 -> 101, 0 -> 1. See Song and Wu. - Michel Marcus, Jul 21 2020
For n > 0, a(n) is the number of nonisomorphic quasitrivial semigroups with n elements, see Devillet, Marichal, Teheux. A292932 is the number of labeled quasitrivial semigroups. - Peter Jipsen, Mar 28 2021
a(n) is the permanent of the n X n tridiagonal matrix defined in A332602. - Stefano Spezia, Apr 12 2022
From Greg Dresden, May 08 2023: (Start)
For n >= 2, 4*a(n) is the number of ways to tile this T-shaped figure of length n-1 with two colors of squares and one color of domino; shown here is the figure of length 5 (corresponding to n=6), and it has 4*a(6) = 396 different tilings.
_
|| _
|||_|||
|_|
(End)
12*a(n) = number of walks of length n in the cyclic Kautz digraph CK(3,4). - Miquel A. Fiol, Feb 15 2024

Examples

			Convergents are 1, 3/2, 7/5, 17/12, 41/29, 99/70, 239/169, 577/408, 1393/985, 3363/2378, 8119/5741, 19601/13860, 47321/33461, 114243/80782, ... = A001333/A000129.
The 15 3 X 2 crossword grids, with white squares represented by an o:
  ooo ooo ooo ooo ooo ooo ooo oo. o.o .oo o.. .o. ..o oo. .oo
  ooo oo. o.o .oo o.. .o. ..o ooo ooo ooo ooo ooo ooo .oo oo.
G.f. = 1 + x + 3*x^2 + 7*x^3 + 17*x^4 + 41*x^5 + 99*x^6 + 239*x^7 + 577*x^8 + ...
		

References

  • M. R. Bacon and C. K. Cook, Some properties of Oresme numbers and convolutions ..., Fib. Q., 62:3 (2024), 233-240.
  • A. H. Beiler, Recreations in the Theory of Numbers. New York: Dover, pp. 122-125, 1964.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 204.
  • John Derbyshire, Prime Obsession, Joseph Henry Press, April 2004, see p. 16.
  • J. Devillet, J.-L. Marichal, and B. Teheux, Classifications of quasitrivial semigroups, Semigroup Forum, 100 (2020), 743-764.
  • Maribel Díaz Noguera [Maribel Del Carmen Díaz Noguera], Rigoberto Flores, Jose L. Ramirez, and Martha Romero Rojas, Catalan identities for generalized Fibonacci polynomials, Fib. Q., 62:2 (2024), 100-111.
  • Kenneth Edwards and Michael A. Allen, A new combinatorial interpretation of the Fibonacci numbers squared, Part II, Fib. Q., 58:2 (2020), 169-177.
  • R. P. Grimaldi, Ternary strings with no consecutive 0's and no consecutive 1's, Congressus Numerantium, 205 (2011), 129-149.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §8.5 The Fibonacci and Related Sequences, p. 288.
  • A. F. Horadam, R. P. Loh, and A. G. Shannon, Divisibility properties of some Fibonacci-type sequences, pp. 55-64 of Combinatorial Mathematics VI (Armidale 1978), Lect. Notes Math. 748, 1979.
  • Thomas Koshy, Pell and Pell-Lucas Numbers with Applications, Springer, New York, 2014.
  • Kin Y. Li, Math Problem Book I, 2001, p. 24, Problem 159.
  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 102, Problem 10.
  • J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 224.
  • 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).
  • R. P. Stanley, Enumerative Combinatorics, Volume 1 (1986), p. 203, Example 4.1.2.
  • A. Tarn, Approximations to certain square roots and the series of numbers connected therewith, Mathematical Questions and Solutions from the Educational Times, 1 (1916), 8-12.
  • R. C. Tilley et al., The cell growth problem for filaments, Proc. Louisiana Conf. Combinatorics, ed. R. C. Mullin et al., Baton Rouge, 1970, 310-339.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987, p. 34.

Crossrefs

For denominators see A000129.
See A040000 for the continued fraction expansion of sqrt(2).
See also A078057 which is the same sequence without the initial 1.
Cf. also A002203, A152113.
Row sums of unsigned Chebyshev T-triangle A053120. a(n)= A054458(n, 0) (first column of convolution triangle).
Row sums of A140750, A160756, A135837.
Equals A034182(n-1) + 2 and A084128(n)/2^n. First differences of A052937. Partial sums of A052542. Pairwise sums of A048624. Bisection of A002965.
The following sequences (and others) belong to the same family: A001333, A000129, A026150, A002605, A046717, A015518, A084057, A063727, A002533, A002532, A083098, A083099, A083100, A015519.
Second row of the array in A135597.
Cf. A055099.
Cf. A028859, A001906 / A088305, A033303, A000225, A095263, A003945, A006356, A002478, A214260, A001911 and A000217 for other restricted ternary words.
Cf. Triangle A106513 (alternating row sums).
Equals A293004 + 1.
Cf. A033539, A332602, A086395 (subseq. of primes).

Programs

  • Haskell
    a001333 n = a001333_list !! n
    a001333_list = 1 : 1 : zipWith (+)
                           a001333_list (map (* 2) $ tail a001333_list)
    -- Reinhard Zumkeller, Jul 08 2012
    
  • Magma
    [n le 2 select 1 else 2*Self(n-1)+Self(n-2): n in [1..35]]; // Vincenzo Librandi, Nov 10 2018
    
  • Maple
    A001333 := proc(n) option remember; if n=0 then 1 elif n=1 then 1 else 2*procname(n-1)+procname(n-2) fi end;
    Digits := 50; A001333 := n-> round((1/2)*(1+sqrt(2))^n);
    with(numtheory): cf := cfrac (sqrt(2),1000): [seq(nthnumer(cf,i), i=0..50)];
    a:= n-> (M-> M[2, 1]+M[2, 2])(<<2|1>, <1|0>>^n):
    seq(a(n), n=0..33);  # Alois P. Heinz, Aug 01 2008
    A001333List := proc(m) local A, P, n; A := [1,1]; P := [1,1];
    for n from 1 to m - 2 do P := ListTools:-PartialSums([op(A), P[-2]]);
    A := [op(A), P[-1]] od; A end: A001333List(32); # Peter Luschny, Mar 26 2022
  • Mathematica
    Insert[Table[Numerator[FromContinuedFraction[ContinuedFraction[Sqrt[2], n]]], {n, 1, 40}], 1, 1] (* Stefan Steinerberger, Apr 08 2006 *)
    Table[((1 - Sqrt[2])^n + (1 + Sqrt[2])^n)/2, {n, 0, 29}] // Simplify (* Robert G. Wilson v, May 02 2006 *)
    a[0] = 1; a[1] = 1; a[n_] := a[n] = 2a[n - 1] + a[n - 2]; Table[a@n, {n, 0, 29}] (* Robert G. Wilson v, May 02 2006 *)
    Table[ MatrixPower[{{1, 2}, {1, 1}}, n][[1, 1]], {n, 0, 30}] (* Robert G. Wilson v, May 02 2006 *)
    a=c=0;t={b=1}; Do[c=a+b+c; AppendTo[t,c]; a=b;b=c,{n,40}]; t (* Vladimir Joseph Stephan Orlovsky, Mar 23 2009 *)
    LinearRecurrence[{2, 1}, {1, 1}, 40] (* Vladimir Joseph Stephan Orlovsky, Mar 23 2009 *)
    Join[{1}, Numerator[Convergents[Sqrt[2], 30]]] (* Harvey P. Dale, Aug 22 2011 *)
    Table[(-I)^n ChebyshevT[n, I], {n, 10}] (* Eric W. Weisstein, Apr 04 2017 *)
    CoefficientList[Series[(-1 + x)/(-1 + 2 x + x^2), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 21 2017 *)
    Table[Sqrt[(ChebyshevT[n, 3] + (-1)^n)/2], {n, 0, 20}] (* Eric W. Weisstein, Apr 17 2018 *)
  • PARI
    {a(n) = if( n<0, (-1)^n, 1) * contfracpnqn( vector( abs(n), i, 1 + (i>1))) [1, 1]}; /* Michael Somos, Sep 02 2012 */
    
  • PARI
    {a(n) = polchebyshev(n, 1, I) / I^n}; /* Michael Somos, Sep 02 2012 */
    
  • PARI
    a(n) = real((1 + quadgen(8))^n); \\ Michel Marcus, Mar 16 2021
    
  • PARI
    { for (n=0, 4000, a=contfracpnqn(vector(n, i, 1+(i>1)))[1, 1]; if (a > 10^(10^3 - 6), break); write("b001333.txt", n, " ", a); ); } \\ Harry J. Smith, Jun 12 2009
    
  • Python
    from functools import cache
    @cache
    def a(n): return 1 if n < 2 else 2*a(n-1) + a(n-2)
    print([a(n) for n in range(32)]) # Michael S. Branicky, Nov 13 2022
  • Sage
    from sage.combinat.sloane_functions import recur_gen2
    it = recur_gen2(1,1,2,1)
    [next(it) for i in range(30)] ## Zerinvary Lajos, Jun 24 2008
    
  • Sage
    [lucas_number2(n,2,-1)/2 for n in range(0, 30)] # Zerinvary Lajos, Apr 30 2009
    

Formula

a(n) = A055642(A125058(n)). - Reinhard Zumkeller, Feb 02 2007
a(n) = 2a(n-1) + a(n-2);
a(n) = ((1-sqrt(2))^n + (1+sqrt(2))^n)/2.
a(n)+a(n+1) = 2 A000129(n+1). 2*a(n) = A002203(n).
G.f.: (1 - x) / (1 - 2*x - x^2) = 1 / (1 - x / (1 - 2*x / (1 + x))). - Simon Plouffe in his 1992 dissertation.
A000129(2n) = 2*A000129(n)*a(n). - John McNamara, Oct 30 2002
a(n) = (-i)^n * T(n, i), with T(n, x) Chebyshev's polynomials of the first kind A053120 and i^2 = -1.
a(n) = a(n-1) + A052542(n-1), n>1. a(n)/A052542(n) converges to sqrt(1/2). - Mario Catalani (mario.catalani(AT)unito.it), Apr 29 2003
E.g.f.: exp(x)cosh(x*sqrt(2)). - Paul Barry, May 08 2003
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2k)2^k. - Paul Barry, May 13 2003
For n > 0, a(n)^2 - (1 + (-1)^(n))/2 = Sum_{k=0..n-1} ((2k+1)*A001653(n-1-k)); e.g., 17^2 - 1 = 288 = 1*169 + 3*29 + 5*5 + 7*1; 7^2 = 49 = 1*29 + 3*5 + 5*1. - Charlie Marion, Jul 18 2003
a(n+2) = A078343(n+1) + A048654(n). - Creighton Dement, Jan 19 2005
a(n) = A000129(n) + A000129(n-1) = A001109(n)/A000129(n) = sqrt(A001110(n)/A000129(n)^2) = ceiling(sqrt(A001108(n))). - Henry Bottomley, Apr 18 2000
Also the first differences of A000129 (the Pell numbers) because A052937(n) = A000129(n+1) + 1. - Graeme McRae, Aug 03 2006
a(n) = Sum_{k=0..n} A122542(n,k). - Philippe Deléham, Oct 08 2006
For another recurrence see A000129.
a(n) = Sum_{k=0..n} A098158(n,k)*2^(n-k). - Philippe Deléham, Dec 26 2007
a(n) = upper left and lower right terms of [1,1; 2,1]^n. - Gary W. Adamson, Mar 12 2008
If p[1]=1, and p[i]=2, (i>1), and if A is Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise. Then, for n>=1, a(n)=det A. - Milan Janjic, Apr 29 2010
For n>=2, a(n)=F_n(2)+F_(n+1)(2), where F_n(x) is Fibonacci polynomial (cf. A049310): F_n(x) = Sum_{i=0..floor((n-1)/2)} binomial(n-i-1,i)x^(n-2*i-1). - Vladimir Shevelev, Apr 13 2012
a(-n) = (-1)^n * a(n). - Michael Somos, Sep 02 2012
Dirichlet g.f.: (PolyLog(s,1-sqrt(2)) + PolyLog(s,1+sqrt(2)))/2. - Ilya Gutkovskiy, Jun 26 2016
a(n) = A000129(n) - A000129(n-1), where A000129(n) is the n-th Pell Number. Hence the continued fraction is of the form 1-(A000129(n-1)/A000129(n)). - Gregory L. Simay, Nov 09 2018
a(n) = (A000129(n+3) + A000129(n-3))/10, n>=3. - Paul Curtz, Jun 16 2021
a(n) = (A000129(n+6) - A000129(n-6))/140, n>=6. - Paul Curtz, Jun 20 2021
a(n) = round((1/2)*sqrt(Product_{k=1..n} 4*(1 + sin(k*Pi/n)^2))), for n>=1. - Greg Dresden, Dec 28 2021
a(n)^2 + a(n+1)^2 = A075870(n+1) = 2*(b(n)^2 + b(n+1)^2) for all n in Z where b(n) := A000129(n). - Michael Somos, Apr 02 2022
a(n) = 2*A048739(n-2)+1. - R. J. Mathar, Feb 01 2024
Sum_{n>=1} 1/a(n) = 1.5766479516393275911191017828913332473... - R. J. Mathar, Feb 05 2024
From Peter Bala, Jul 06 2025: (Start)
G.f.: Sum_{n >= 1} (-1)^(n+1) * x^(n-1) * Product_{k = 1..n} (1 - k*x)/(1 - 3*x + k*x^2).
The following series telescope:
Sum_{n >= 1} (-1)^(n+1)/(a(2*n) + 1/a(2*n)) = 1/4, since 1/(a(2*n) + 1/a(2*n)) = 1/A077445(n) + 1/A077445(n+1).
Sum_{n >= 1} (-1)^(n+1)/(a(2*n+1) - 1/a(2*n+1)) = 1/8, since. 1/(a(2*n+1) - 1/a(2*n+1)) = 1/(4*Pell(2*n)) + 1/(4*Pell(2*n+2)), where Pell(n) = A000129(n).
Sum_{n >= 1} (-1)^(n+1)/(a(2*n+1) + 9/a(2*n+1)) = 1/10, since 1/(a(2*n+1) + 9/a(2*n+1)) = b(n) + b(n+1), where b(n) = A001109(n)/(2*Pell(2*n-1)*Pell(2*n+1)).
Sum_{n >= 1} (-1)^(n+1)/(a(n)*a(n+1)) = 1 - sqrt(2)/2 = A268682, since (-1)^(n+1)/(a(n)*a(n+1)) = Pell(n)/a(n) - Pell(n+1)/a(n+1). (End)

Extensions

Chebyshev comments from Wolfdieter Lang, Jan 10 2003

A001043 Numbers that are the sum of 2 successive primes.

Original entry on oeis.org

5, 8, 12, 18, 24, 30, 36, 42, 52, 60, 68, 78, 84, 90, 100, 112, 120, 128, 138, 144, 152, 162, 172, 186, 198, 204, 210, 216, 222, 240, 258, 268, 276, 288, 300, 308, 320, 330, 340, 352, 360, 372, 384, 390, 396, 410, 434, 450, 456, 462, 472, 480, 492, 508, 520
Offset: 1

Views

Author

Keywords

Comments

Arithmetic derivative (see A003415) of prime(n)*prime(n+1). - Giorgio Balzarotti, May 26 2011
A008472(a(n)) = A191583(n). - Reinhard Zumkeller, Jun 28 2011
With the exception of the first term, all terms are even. a(n) is divisible by 4 if the difference between prime(n) and prime(n + 1) is not divisible by 4; e.g., prime(n) = 1 mod 4 and prime(n + 1) = 3 mod 4. In general, for a(n) to be divisible by some even number m > 2 requires that prime(n + 1) - prime(n) not be a multiple of m. - Alonso del Arte, Jan 30 2012

Examples

			2 + 3 = 5.
3 + 5 = 8.
5 + 7 = 12.
7 + 11 = 18.
		

References

  • Archimedeans Problems Drive, Eureka, 26 (1963), 12.
  • 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

Subsequence of A050936.
Cf. A000040 (primes), A031131 (first differences), A092163 (bisection), A100479 (bisection).

Programs

  • Haskell
    a001043 n = a001043_list !! (n-1)
    a001043_list = zipWith (+) a000040_list $ tail a000040_list
    -- Reinhard Zumkeller, Oct 19 2011
  • Magma
    [(NthPrime(n+1) + NthPrime(n)): n in [1..100]]; // Vincenzo Librandi, Apr 02 2011
    
  • Maple
    Primes:= select(isprime,[2,seq(2*i+1,i=1..1000)]):
    n:= nops(Primes):
    Primes[1..n-1] + Primes[2..n]; # Robert Israel, Aug 29 2014
  • Mathematica
    Table[Prime[n] + Prime[n + 1], {n, 55}] (* Ray Chandler, Feb 12 2005 *)
    Total/@Partition[Prime[Range[60]], 2, 1] (* Harvey P. Dale, Aug 23 2011 *)
    Abs[Differences[Table[(-1)^n Prime[n], {n, 60}]]] (* Alonso del Arte, Feb 03 2016 *)
  • PARI
    p=2;forprime(q=3,1e3,print1(p+q", ");p=q) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    is(n)=precprime((n-1)/2)+nextprime(n/2)==n&&n>2 \\ Charles R Greathouse IV, Jun 21 2012
    
  • Sage
    BB = primes_first_n(56)
    L = []
    for i in range(55): L.append(BB[1 + i] + BB[i])
    L # Zerinvary Lajos, May 14 2007
    

Formula

a(n) = prime(n) + prime(n + 1) = A000040(n) + A000040(n+1).
a(n) = A116366(n, n - 1) for n > 1. - Reinhard Zumkeller, Feb 06 2006
a(n) = 2*A024675(n-1), n>1. - R. J. Mathar, Jan 12 2024

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 17 2000

A001158 sigma_3(n): sum of cubes of divisors of n.

Original entry on oeis.org

1, 9, 28, 73, 126, 252, 344, 585, 757, 1134, 1332, 2044, 2198, 3096, 3528, 4681, 4914, 6813, 6860, 9198, 9632, 11988, 12168, 16380, 15751, 19782, 20440, 25112, 24390, 31752, 29792, 37449, 37296, 44226, 43344, 55261, 50654, 61740, 61544, 73710, 68922, 86688
Offset: 1

Views

Author

Keywords

Comments

If the canonical factorization of n into prime powers is the product of p^e(p) then sigma_k(n) = Product_p ((p^((e(p)+1)*k))-1)/(p^k-1).
Sum_{d|n} 1/d^k is equal to sigma_k(n)/n^k. So sequences A017665-A017712 also give the numerators and denominators of sigma_k(n)/n^k for k = 1..24. The power sums sigma_k(n) are in sequences A000203 (k=1), A001157-A001160 (k=2,3,4,5), A013954-A013972 for k = 6..24. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 05 2001
Also the eigenvalues of the Hecke operator T_n for the entire modular normalized Eisenstein form E_4(z) (see A004009): T_n E_4 = a(n) E_4, n >= 1. For the Hecke operator T_n and eigenforms see, e.g., the Koecher-Krieg reference, p. 207, eq. (5) and p. 211, section 4, or the Apostol reference p. 120, eq. (13) and pp. 129 - 133. - Wolfdieter Lang, Jan 28 2016

Examples

			G.f. = x + 9*x^2 + 28*x^3 + 73*x^4 + 126*x^5 + 252*x^6 + 344*x^7 + ...
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math.Series 55, Tenth Printing, 1972, p. 827.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 38.
  • T. M. Apostol, Modular Functions and Dirichlet Series in Number Theory, Second edition, Springer, 1990, pp. 120, 129 - 133.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, AMS Chelsea Publishing, Providence, Rhode Island, 2002, p. 166.
  • Max Koecher and Aloys Krieg, Elliptische Funktionen und Modulformen, 2. Auflage, Springer, 2007, pp. 207, 211.
  • 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).
  • Zagier, Don. "Elliptic modular forms and their applications." The 1-2-3 of modular forms. Springer Berlin Heidelberg, 2008. 1-103. See p. 17, G_4(z).

Crossrefs

Cf. A004009, A064603 (partial sums).

Programs

  • Haskell
    a001158 n = product $ zipWith (\p e -> (p^(3*e + 3) - 1) `div` (p^3 - 1))
                          (a027748_row n) (a124010_row n)
    -- Reinhard Zumkeller, Jun 30 2013
    
  • Magma
    [DivisorSigma(3,n): n in [1..40]]; // Bruno Berselli, Apr 10 2013
    
  • Maple
    seq(numtheory:-sigma[3](n),n=1..100); # Robert Israel, Feb 05 2016
  • Mathematica
    Table[DivisorSigma[3,n],{n,100}] (* corrected by T. D. Noe, Mar 22 2009 *)
  • Maxima
    makelist(divsum(n,3),n,1,100); /* Emanuele Munarini, Mar 26 2011 */
    
  • PARI
    N=99; q='q+O('q^N);
    Vec(sum(n=1,N,n^3*q^n/(1-q^n))) /* Joerg Arndt, Feb 04 2011 */
    
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, d^3))}; /* Michael Somos, Jan 07 2017 */
    
  • Python
    from sympy import divisor_sigma
    def a(n): return divisor_sigma(n, 3)
    print([a(n) for n in range(1, 43)]) # Michael S. Branicky, Jan 09 2021
  • Sage
    [sigma(n, 3) for n in range(1, 40)]  # Zerinvary Lajos, Jun 04 2009
    

Formula

Multiplicative with a(p^e) = (p^(3e+3)-1)/(p^3-1). - David W. Wilson, Aug 01 2001
Dirichlet g.f. zeta(s)*zeta(s-3). - R. J. Mathar, Mar 04 2011
G.f.: sum(k>=1, k^3*x^k/(1-x^k)). - Benoit Cloitre, Apr 21 2003
Equals A051731 * [1, 8, 27, 64, 125, ...] = A127093 * [1, 4, 9, 16, 25, ...]. - Gary W. Adamson, Nov 02 2007
L.g.f.: -log(Product_{j>=1} (1-x^j)^(j^2)) = (1/1)*z^1 + (9/2)*z^2 + (28/3)*z^3 + (73/4)*z^4 + ... + (a(n)/n)*z^n + ... - Joerg Arndt, Feb 04 2011
a(n) = Sum{d|n} tau_{-2}^d*J_3(n/d), where tau_{-2} is A007427 and J_3 is A059376. - Enrique Pérez Herrero, Jan 19 2013
a(n) = A004009(n)/240. - Artur Jasinski, Sep 06 2016. See, e.g., Hardy, p. 166, (10.5.6), with Q = E_4, and with present offset 0. - Wolfdieter Lang, Jan 31 2017
8*a(n) = sum of cubes of even divisors of 2*n. - Wolfdieter Lang, Jan 07 2017
G.f.: Sum_{n >= 1} x^n*(1 + 4*x^n + x^(2*n))/(1 - x^n)^4. - Peter Bala, Jan 11 2021
Faster converging g.f.: Sum_{n >= 1} q^(n^2)*( n^3 + ((n + 1)^3 - 3*n^3)*q^n + (4 - 6*n^2)*q^(2*n) + (3*n^3 - (n - 1)^3)*q^(3*n) - n^3*q^(4*n) )/(1 - q^n)^4 - apply the operator x*d/dx three times to equation 5 in Arndt and then set x = 1. - Peter Bala, Jan 21 2021
a(n) = Sum_{1 <= i, j, k <= n} tau(gcd(i, j, k, n)) = Sum_{d divides n} tau(d)* J_3(n/d), where the divisor function tau(n) = A000005(n) and the Jordan totient function J_3(n) = A059376(n). - Peter Bala, Jan 22 2024

A005251 a(0) = 0, a(1) = a(2) = a(3) = 1; thereafter, a(n) = a(n-1) + a(n-2) + a(n-4).

Original entry on oeis.org

0, 1, 1, 1, 2, 4, 7, 12, 21, 37, 65, 114, 200, 351, 616, 1081, 1897, 3329, 5842, 10252, 17991, 31572, 55405, 97229, 170625, 299426, 525456, 922111, 1618192, 2839729, 4983377, 8745217, 15346786, 26931732, 47261895, 82938844, 145547525, 255418101, 448227521
Offset: 0

Views

Author

Keywords

Comments

a(n+3) is the number of n-bit sequences that avoid 010. Example: For n=4 the 12 sequences are all 4-bit sequences except 0100, 0101, 0010, 1010. - David Callan, Mar 25 2004
a(n+2) is the number of compositions (ordered partitions) of n where no two adjacent parts are != 1, see example. - Joerg Arndt, Jan 26 2013
a(n+1) is the number of compositions of n avoiding the part 2. - Joerg Arndt, Jul 13 2014
Number of different positive braids with n crossings of 3 strands.
This is a_2(n) in the Doroslovacki reference. Note that there is a typo in the paper in the formula for a_2(n): the upper bound in the inner sum should be "n-i" not "i-1". - Max Alekseyev, Jun 26 2007
a(n) is the number of peakless Motzkin paths of length n-1 with no UHH...HD's starting at level > 0 (here n > 0 and U=(1,1), H=(1,0), D=(1,-1)). Example: a(5)=7 because from all 8 peakless Motzkin paths of length 5 (see A004148) only UUHDD does not qualify. - Emeric Deutsch, Sep 13 2004
Equals the INVERT transform of (1, 0, 1, 1, 1, ...); equivalent to a(n) = a(n-1) + a(n-3) + a(n-4) + ... - Gary W. Adamson, Apr 27 2009
a(n) is the number of length n-1 words on {0,1} such that each string of 1's is followed by a string of at least two 0's. For example, a(5) = 4 because we have: 0000, 0100, 1000, and 1100. - Geoffrey Critzer, Aug 09 2013
a(n+1) is the top left entry of the n-th power of any of the 3 X 3 matrices [1, 1, 0; 0, 1, 1; 1, 0, 0] or [1, 0, 1; 1, 1, 0; 0, 1, 0] or [1, 1, 0; 0, 0, 1; 1, 0, 1] or [1, 0, 1; 1, 0, 0; 0, 1, 1]. - R. J. Mathar, Feb 03 2014
For n >= 2, a(n) is the number of (n-2)-length binary words with no isolated zeros. - Milan Janjic, Mar 07 2015
Apart from the first three terms, the total number of bargraphs of semiperimeter n of height at most two for n >= 2 starts 1, 2, 4, 7, 12, ... - Arnold Knopfmacher, Nov 02 2016
Number of DD-equivalence classes of Łukasiewicz paths. Łukasiewicz paths are DD-equivalent iff the positions of pattern DD are identical in these paths. - Sergey Kirgizov, Apr 08 2018
From Gus Wiseman, Nov 25 2019: (Start)
For n > 0, also the number of subsets of {1, ..., n - 3} such that if x and x + 2 are both in the subset, then so is x + 1. For example, the a(3) = 1 through a(7) = 12 subsets are:
{} {} {} {} {}
{1} {1} {1} {1}
{2} {2} {2}
{1,2} {3} {3}
{1,2} {4}
{2,3} {1,2}
{1,2,3} {1,4}
{2,3}
{3,4}
{1,2,3}
{2,3,4}
{1,2,3,4}
(End)
The two-dimensional version, which counts sets of pairs where, if two pairs are separated by graph-distance 2, then the intermediate pair or pairs are also in the set, is A329871. - Gus Wiseman, Nov 30 2019
a(n+1) is the number of ways to tile a strip of length n with squares, dominoes, and tetrominoes, where the first tile cannot be a domino. - Greg Dresden and Myanna Nash, Aug 18 2020

Examples

			From _Joerg Arndt_, Jan 26 2013: (Start)
The a(5+2) = 12 compositions of 5 where no two adjacent parts are != 1 are
  [ 1]  [ 1 1 1 1 1 ]
  [ 2]  [ 1 1 1 2 ]
  [ 3]  [ 1 1 2 1 ]
  [ 4]  [ 1 1 3 ]
  [ 5]  [ 1 2 1 1 ]
  [ 6]  [ 1 3 1 ]
  [ 7]  [ 1 4 ]
  [ 8]  [ 2 1 1 1 ]
  [ 9]  [ 2 1 2 ]
  [10]  [ 3 1 1 ]
  [11]  [ 4 1 ]
  [12]  [ 5 ]
(End)
G.f. = x + x^2 + x^3 + 2*x^4 + 4*x^5 + 7*x^6 + 12*x^7 + 21*x^8 + 37*x^9 + ...
		

References

  • S. Burckel, Efficient methods for three strand braids (submitted). [Apparently unpublished]
  • P. Chinn and S. Heubach, "Compositions of n with no occurrence of k", Congressus Numeratium, 2002, v. 162, pp. 33-51.
  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, p. 205.
  • R. K. Guy, "Anyone for Twopins?" in D. A. Klarner, editor, The Mathematical Gardner. Prindle, Weber and Schmidt, Boston, 1981, pp. 2-15.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Bisection of Padovan sequence A000931.
Partial sums of A005314 shifted 3 times to the right, if we assume A005314(0) = 1.
Compositions without adjacent equal parts are A003242.
Compositions without isolated parts are A114901.
Row sums of A097230(n-2) for n>1.

Programs

  • Haskell
    a005251 n = a005251_list !! n
    a005251_list = 0 : 1 : 1 : 1 : zipWith (+) a005251_list
       (drop 2 $ zipWith (+) a005251_list (tail a005251_list))
    -- Reinhard Zumkeller, Dec 28 2011
    
  • Magma
    I:=[0,1,1,1]; [n le 4 select I[n] else Self(n-1)+Self(n-2)+Self(n-4): n in [1..45]]; // Vincenzo Librandi, Nov 30 2018
    
  • Magma
    R:=PowerSeriesRing(Integers(), 40); [0] cat Coefficients(R!( x*(1-x)/(1-2*x + x^2 - x^3) )); // Marius A. Burtea, Oct 24 2019
    
  • Maple
    A005251 := proc(n) option remember; if n <= 2 then n elif n = 3 then 4 else 2*A005251(n - 1) - A005251(n - 2) + A005251(n - 3); fi; end;
    A005251:=(-1+z)/(-1+2*z-z**2+z**3); # Simon Plouffe in his 1992 dissertation
    a := n -> `if`(n<=1, n, hypergeom([(2-n)/3, 1-n/3, (1-n)/3], [1/2, -n+1], 27/4)):
    seq(simplify(a(n)), n=0..36); # Peter Luschny, Apr 08 2018
  • Mathematica
    LinearRecurrence[{2,-1,1},{0,1,1},40]  (* Harvey P. Dale, May 05 2011 *)
    a[ n_]:= If[n<0, SeriesCoefficient[ -x(1-x)/(1 -x + 2x^2 -x^3), {x, 0, -n}], SeriesCoefficient[ x(1-x)/(1 -2x +x^2 -x^3), {x, 0, n}]] (* Michael Somos, Dec 13 2013 *)
    a[0] = 1; a[1] = a[2] = 0; a[n_] := a[n] = a[n-2] + a[n-3]; Table[a[2 n-1], {n, 1, 20}] (* Rigoberto Florez, Oct 15 2019 *)
    Table[If[n==0,0,Length[DeleteCases[Subsets[Range[n-3]],{_,x_,y_,_}/;x+2==y]]],{n,0,10}] (* Gus Wiseman, Nov 25 2019 *)
  • PARI
    Vec((1-x)/(1-2*x+x^2-x^3)+O(x^99)) /* Charles R Greathouse IV, Nov 20 2012 */
    
  • PARI
    {a(n) = if( n<0, polcoeff( -x*(1-x)/(1 -x +2*x^2 -x^3) + x*O(x^-n), -n), polcoeff( x*(1-x)/(1 -2*x +x^2 -x^3) + x*O(x^n), n))} /* Michael Somos, Dec 13 2013 */
    
  • SageMath
    [sum( binomial(n-j-1, 2*j) for j in (0..floor((n-1)/3)) ) for n in (0..50)] # G. C. Greubel, Apr 13 2022

Formula

a(n) = 2*a(n-1) - a(n-2) + a(n-3).
G.f.: z*(1-z)/(1 - 2*z + z^2 - z^3). - Emeric Deutsch, Sep 13 2004
23*a_n = 3*P_{2n+1} + 7*P_{2n} - 2*P_{2n-1}, where P_n are the Perrin numbers, A001608. - Don Knuth, Dec 09 2008
a(n+1) = Sum_{k=0..n} binomial(n-k, 2k). - Richard L. Ollerton, May 12 2004
From Henry Bottomley, Feb 21 2001: (Start)
a(n) = (Sum_{j
a(n) = A005314(n) - A005314(n-1).
a(n) = A049853(n-1) - a(n-1).
a(n) = A005314(n) - a(n-2). (End)
Conjecture: a(n+1) + |A078065(n)| = 2*A005314(n+1). - Creighton Dement, Dec 21 2004
a(n+2) has g.f. (F_3(-x) + F_2(-x))/(F_4(-x) + F_3(-x)) = 1/(-x+1/(-x+1/(-x+1))) where F_n(x) is the n-th Fibonacci polynomial; see A011973. - Qiaochu Yuan (qchu(AT)mit.edu), Feb 19 2009
a(n) = A173022(2^(n-2) - 1) for n > 1. - Reinhard Zumkeller, Feb 07 2010
BINOMIAL transform of A176971 is a(n+1). - Michael Somos, Dec 13 2013
a(n) = hypergeom([(2-n)/3, 1-n/3, (1-n)/3], [1/2, -n+1], 27/4) for n > 1. - Peter Luschny, Apr 08 2018
G.f.: z/(1-z-z^3-z^4-z^5-...) for the compositions of n-1 avoiding 2. The g.f. for the number of compositions of n avoiding the part k is 1/(1-z-...-z^(k-1) - z^(k+1)-...). - Gregory L. Simay, Sep 09 2018
If p,q,r are the three solutions to x^3 = 2x^2 - x + 1, then a(n) = (p-1)*p^n/((p-q)*(p-r)) + (q-1)*q^n/((q-p)*(q-r)) + (r-1)*r^n/((r-p)*(r-q)). - Greg Dresden and AnXing Yang, Aug 12 2025

A001047 a(n) = 3^n - 2^n.

Original entry on oeis.org

0, 1, 5, 19, 65, 211, 665, 2059, 6305, 19171, 58025, 175099, 527345, 1586131, 4766585, 14316139, 42981185, 129009091, 387158345, 1161737179, 3485735825, 10458256051, 31376865305, 94134790219, 282412759265, 847255055011, 2541798719465, 7625463267259, 22876524019505
Offset: 0

Keywords

Comments

a(n+1) is the sum of the elements in the n-th row of triangle pertaining to A036561. - Amarnath Murthy, Jan 02 2002
Number of 2 X n binary arrays with a path of adjacent 1's and no path of adjacent 0's from top row to bottom row. - R. H. Hardin, Mar 21 2002
With offset 1, partial sums of A027649. - Paul Barry, Jun 24 2003
Number of distinct lines through the origin in the n-dimensional lattice of side length 2. A049691 has the values for the 2-dimensional lattice of side length n. - Joshua Zucker, Nov 19 2003
a(n+1)/(n+1)=(3*3^n-2*2^n)/(n+1) is the second binomial transform of the harmonic sequence 1/(n+1). - Paul Barry, Apr 19 2005
a(n+1) is the sum of n-th row of A036561. - Reinhard Zumkeller, May 14 2006
The sequence gives the sum of the lengths of the segments in Cantor's dust generating sequence up to the i-th step. Measurement unit = length of the segment of i-th step. - Giorgio Balzarotti, Nov 18 2006
Let T be a binary relation on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xTy if x is a proper subset of y. Then a(n) = |T|. - Ross La Haye, Dec 22 2006
From Alexander Adamchuk, Jan 04 2007: (Start)
a(n) is prime for n in A057468.
p divides a(p) - 1 for prime p.
Quotients (3^p - 2^p - 1)/p, where p = prime(n), are listed in A127071.
Numbers k such that k divides 3^k - 2^k - 1 are listed in A127072.
Pseudoprimes in A127072(n) include all powers of primes {2,3,7} and some composite numbers that are listed in A127073, which includes all Carmichael numbers A002997.
Numbers n such that n^2 divides 3^n - 2^n - 1 are listed in A127074.
5 divides a(2n).
5^2 divides a(2*5n).
5^3 divides a(2*5^2n).
5^4 divides a(2*5^3n).
7^2 divides a(6*7n).
13 divides a(4n).
13^2 divides a(4*13n).
19 divides a(3n).
19^2 divides a(3*19n).
23^2 divides a(11n).
23^3 divides a(11*23n).
23^4 divides a(11*23^2n).
29 divides a(7n).
p divides a((p-1)n) for prime p>3.
p divides a((p-1)/2) for prime p in A097934. Also primes p such that 6 is a square mod p, except {2,3}, A038876(n).
p^(k+1) divides a(p^k*(p-1)/2*n) for prime p in A097934.
p^(k+1) divides a(p^k*(p-1)*n) for prime p>3.
Note the exception that for p = 23, p^(k+2) divides a(p^k*(p-1)/2*n).
There are no more such exceptions for primes p up to 600000. (End)
a(n) divides a(q*(n+1)-1), for all q integer. Leonardo Sarasua, Apr 15 2024
Final digits of terms follow sequence 1,5,9,5. - Enoch Haga, Nov 26 2007
This is also the second column sequence of the Sheffer triangle A143494 (2-restricted Stirling2 numbers). See the e.g.f. given below. - Wolfdieter Lang, Oct 08 2011
Partial sums give A000392. - Jon Perry, Apr 05 2014
For n >= 1, this is also row 2 of A281890: when consecutive positive integers are written as a product of primes in nondecreasing order, "3" occurs in n-th position a(n) times out of every 6^n. - Peter Munn, May 17 2017
a(n) is the number of ternary sequences of length n which include the digit 2. For example, a(2)=5 since the sequences are 02,20,12,21,22. - Enrique Navarrete, Apr 05 2021
a(n-1) is the number of ways we can form disjoint unions of two nonempty subsets of [n] such that the union contains n. For example, for n = 3, a(2) = 5 since the disjoint unions are {1}U{3}, {1}U{2,3}, {2}U{3}, {2}U{1,3}, and {1,2}U{3}. Cf. A000392 if we drop the requirement that the union contains n. - Enrique Navarrete, Aug 24 2021
Configures as a composite Koch Snowflake Fractal (see illustration in links) based on the five-fold division of the Cantor Square/Cantor Dust Fractal of (9^n-4^n)/5 see my illustration in (A016153). - John Elias, Oct 13 2021
Number of pairs (A,B) where B is a subset of {1,2,...,n} and A is a proper subset of B. - Jianing Song, Jun 18 2022
From Manfred Boergens, Mar 29 2023: (Start)
With regard to the comments by Ross La Haye and Jianing Song: Omitting "proper" gives A000244.
Number of pairs (A,B) where B is a nonempty subset of {1,2,...,n} and A is a nonempty subset of B. For nonempty proper subsets see a(n+1) in A028243. (End)
a(n) is the number of n-digit numbers whose smallest decimal digit is 7. - Stefano Spezia, Nov 15 2023
a(n-1) is the number of all possible player-reduced binary games observed by each player in an nx2 game assuming the individual strategies of k < n - 1 players are fixed and the remaining n - k - 1 player will play as one, either maintaining their status quo strategies or jointly adopting an alternative strategy. - Ambrosio Valencia-Romero, Apr 11 2024

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 86-87.
  • 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(n) = row sums of A091913, row 2 of A047969, column 1 of A090888 and column 1 of A038719.
Cf. partitions: A241766, A241759.
A diagonal of A262307.

Programs

  • Haskell
    a001047 n = a001047_list !! n
    a001047_list = map fst $ iterate (\(u, v) -> (3 * u + v, 2 * v)) (0, 1)
    -- Reinhard Zumkeller, Jun 09 2013
  • Magma
    [3^n - 2^n: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Maple
    seq(3^n - 2^n, n=0..40); # Giorgio Balzarotti, Nov 18 2006
    A001047:=1/(3*z-1)/(2*z-1); # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[ 3^n - 2^n, {n, 0, 25} ]
    LinearRecurrence[{5, -6}, {0, 1}, 25] (* Harvey P. Dale, Aug 18 2011 *)
    Numerator@NestList[(3#+1)/2&,1/2,100] (* Zak Seidov, Oct 03 2011 *)
  • PARI
    {a(n) = 3^n - 2^n};
    
  • Python
    [3**n - 2**n for n in range(25)] # Ross La Haye, Aug 19 2005; corrected by David Radcliffe, Jun 26 2016
    
  • Sage
    [lucas_number1(n, 5, 6) for n in range(26)]  # Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: x/((1-2*x)*(1-3*x)).
a(n) = 5*a(n-1) - 6*a(n-2).
a(n) = 3*a(n-1) + 2^(n-1). - Jon Perry, Aug 23 2002
Starting 0, 0, 1, 5, 19, ... this is 3^n/3 - 2^n/2 + 0^n/6, the binomial transform of A086218. - Paul Barry, Aug 18 2003
a(n) = A083323(n)-1 = A056182(n)/2 = (A002783(n)-1)/2 = (A003063(n+2)-A003063(n+1))/2. - Ralf Stephan, Jan 12 2004
Binomial transform of A000225. - Ross La Haye, Feb 07 2005
a(n) = Sum_{k=0..n-1} binomial(n, k)*2^k. - Ross La Haye, Aug 20 2005
a(n) = 2^(2n) - A083324(n). - Ross La Haye, Sep 10 2005
a(n) = A112626(n, 1). - Ross La Haye, Jan 11 2006
E.g.f.: exp(3*x) - exp(2*x). - Mohammad K. Azarian, Jan 14 2009
a(n) = A217764(n,1). - Ross La Haye, Mar 27 2013
a(n) = 2*a(n-1) + 3^(n-1). - Toby Gottfried, Mar 28 2013
a(n) = A000244(n) - A000079(n). - Omar E. Pol, Mar 28 2013
a(n) = Sum_{k=0..2} Stirling1(2,k)*(k+1)^n = c_2^{(-n)}, poly-Cauchy numbers. - Takao Komatsu, Mar 28 2013
a(n) = A227048(n,A098294(n)). - Reinhard Zumkeller, Jun 30 2013
a(n+1) = Sum_{k=0..n} 2^k*3^(n-k). - J. M. Bergot, Mar 27 2018
Sum_{n>=1} 1/a(n) = A329064. - Amiram Eldar, Nov 20 2020
a(n) = (1/2)*Sum_{k=0..n} binomial(n, k)*(2^(n-k) + 2^k - 2).
a(n) = A001117(n) + 2*A000918(n) + 1. - Ambrosio Valencia-Romero, Mar 08 2022
a(n) = A000225(n) + A028243(n+1). - Ambrosio Valencia-Romero, Mar 09 2022
From Peter Bala, Jun 27 2025: (Start)
exp(Sum_{n >=1} a(2*n)/a(n)*x^n/n) = Sum_{n >= 0} a(n+1)*x^n.
exp(Sum_{n >=1} a(3*n)/a(n)*x^n/n) = 1 + 19*x + 247*x^2 + ... is the g.f. of A019443.
exp(Sum_{n >=1} a(4*n)/a(n)*x^n/n) = 1 + 65*x + 2743*x^2 + ... is the g.f. of A383754.
The following are all examples of telescoping series:
Sum_{n >= 1} 6^n/(a(n)*a(n+1)) = 2, since 6^n/(a(n)*a(n+1)) = b(n) - b(n+1), where b(n) = 2^n/a(n);
Sum_{n >= 1} 18^n/(a(n)*a(n+1)*a(n+2)) = 22/75, since 18^n/(a(n)*a(n+1)*a(n+2)) = c(n) - c(n+1), where c(n) = (5*6^n - 2*4^n)/(15*a(n)*a(n+1));
Sum_{n >= 1} 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = 634/48735 since 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = d(n) - d(n+1), where d(n) = (57*18^n - 38*12^n + 8*8^n)/(513*a(n)*a(n+1)*a(n+2)).
Sum_{n >= 1} 6^n/(a(n)*a(n+2)) = 14/25; Sum_{n >= 1} (-6)^n/(a(n)*a(n+2)) = -6/25.
Sum_{n >= 1} 6^n/(a(n)*a(n+3)) = 306/1805.
Sum_{n >= 1} 6^n/(a(n)*a(n+4)) = 4282/80275; Sum_{n >= 1} (-6)^n/(a(n)*a(n+4)) = -1698/80275. (End)

Extensions

Edited by Charles R Greathouse IV, Mar 24 2010
Showing 1-10 of 79 results. Next