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

A000012 The simplest sequence of positive numbers: the all 1's sequence.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, May 16 1994

Keywords

Comments

Number of ways of writing n as a product of primes.
Number of ways of writing n as a sum of distinct powers of 2.
Continued fraction for golden ratio A001622.
Partial sums of A000007 (characteristic function of 0). - Jeremy Gardiner, Sep 08 2002
An example of an infinite sequence of positive integers whose distinct pairwise concatenations are all primes! - Don Reble, Apr 17 2005
Binomial transform of A000007; inverse binomial transform of A000079. - Philippe Deléham, Jul 07 2005
A063524(a(n)) = 1. - Reinhard Zumkeller, Oct 11 2008
For n >= 0, let M(n) be the matrix with first row = (n n+1) and 2nd row = (n+1 n+2). Then a(n) = absolute value of det(M(n)). - K.V.Iyer, Apr 11 2009
The partial sums give the natural numbers (A000027). - Daniel Forgues, May 08 2009
From Enrique Pérez Herrero, Sep 04 2009: (Start)
a(n) is also tau_1(n) where tau_2(n) is A000005.
a(n) is a completely multiplicative arithmetical function.
a(n) is both squarefree and a perfect square. See A005117 and A000290. (End)
Also smallest divisor of n. - Juri-Stepan Gerasimov, Sep 07 2009
Also decimal expansion of 1/9. - Enrique Pérez Herrero, Sep 18 2009; corrected by Klaus Brockhaus, Apr 02 2010
a(n) is also the number of complete graphs on n nodes. - Pablo Chavez (pchavez(AT)cmu.edu), Sep 15 2009
Totally multiplicative sequence with a(p) = 1 for prime p. Totally multiplicative sequence with a(p) = a(p-1) for prime p. - Jaroslav Krizek, Oct 18 2009
n-th prime minus phi(prime(n)); number of divisors of n-th prime minus number of perfect partitions of n-th prime; the number of perfect partitions of n-th prime number; the number of perfect partitions of n-th noncomposite number. - Juri-Stepan Gerasimov, Oct 26 2009
For all n>0, the sequence of limit values for a(n) = n!*Sum_{k>=n} k/(k+1)!. Also, a(n) = n^0. - Harlan J. Brothers, Nov 01 2009
a(n) is also the number of 0-regular graphs on n vertices. - Jason Kimberley, Nov 07 2009
Differences between consecutive n. - Juri-Stepan Gerasimov, Dec 05 2009
From Matthew Vandermast, Oct 31 2010: (Start)
1) When sequence is read as a regular triangular array, T(n,k) is the coefficient of the k-th power in the expansion of (x^(n+1)-1)/(x-1).
2) Sequence can also be read as a uninomial array with rows of length 1, analogous to arrays of binomial, trinomial, etc., coefficients. In a q-nomial array, T(n,k) is the coefficient of the k-th power in the expansion of ((x^q -1)/(x-1))^n, and row n has a sum of q^n and a length of (q-1)*n + 1. (End)
The number of maximal self-avoiding walks from the NW to SW corners of a 2 X n grid.
When considered as a rectangular array, A000012 is a member of the chain of accumulation arrays that includes the multiplication table A003991 of the positive integers. The chain is ... < A185906 < A000007 < A000012 < A003991 < A098358 < A185904 < A185905 < ... (See A144112 for the definition of accumulation array.) - Clark Kimberling, Feb 06 2011
a(n) = A007310(n+1) (Modd 3) := A193680(A007310(n+1)), n>=0. For general Modd n (not to be confused with mod n) see a comment on A203571. The nonnegative members of the three residue classes Modd 3, called [0], [1], and [2], are shown in the array A088520, if there the third row is taken as class [0] after inclusion of 0. - Wolfdieter Lang, Feb 09 2012
Let M = Pascal's triangle without 1's (A014410) and V = a variant of the Bernoulli numbers A027641 but starting [1/2, 1/6, 0, -1/30, ...]. Then M*V = [1, 1, 1, 1, ...]. - Gary W. Adamson, Mar 05 2012
As a lower triangular array, T is an example of the fundamental generalized factorial matrices of A133314. Multiplying each n-th diagonal by t^n gives M(t) = I/(I-t*S) = I + t*S + (t*S)^2 + ... where S is the shift operator A129184, and T = M(1). The inverse of M(t) is obtained by multiplying the first subdiagonal of T by -t and the other subdiagonals by zero, so A167374 is the inverse of T. Multiplying by t^n/n! gives exp(t*S) with inverse exp(-t*S). - Tom Copeland, Nov 10 2012
The original definition of the meter was one ten-millionth of the distance from the Earth's equator to the North Pole. According to that historical definition, the length of one degree of latitude, that is, 60 nautical miles, would be exactly 111111.111... meters. - Jean-François Alcover, Jun 02 2013
Deficiency of 2^n. - Omar E. Pol, Jan 30 2014
Consider n >= 1 nonintersecting spheres each with surface area S. Define point p on sphere S_i to be a "public point" if and only if there exists a point q on sphere S_j, j != i, such that line segment pq INTERSECT S_i = {p} and pq INTERSECT S_j = {q}; otherwise, p is a "private point". The total surface area composed of exactly all private points on all n spheres is a(n)*S = S. ("The Private Planets Problem" in Zeitz.) - Rick L. Shepherd, May 29 2014
For n>0, digital roots of centered 9-gonal numbers (A060544). - Colin Barker, Jan 30 2015
Product of nonzero digits in base-2 representation of n. - Franklin T. Adams-Watters, May 16 2016
Alternating row sums of triangle A104684. - Wolfdieter Lang, Sep 11 2016
A fixed point of the run length transform. - Chai Wah Wu, Oct 21 2016
Length of period of continued fraction for sqrt(A002522) or sqrt(A002496). - A.H.M. Smeets, Oct 10 2017
a(n) is also the determinant of the (n+1) X (n+1) matrix M defined by M(i,j) = binomial(i,j) for 0 <= i,j <= n, since M is a lower triangular matrix with main diagonal all 1's. - Jianing Song, Jul 17 2018
a(n) is also the determinant of the symmetric n X n matrix M defined by M(i,j) = min(i,j) for 1 <= i,j <= n (see Xavier Merlin reference). - Bernard Schott, Dec 05 2018
a(n) is also the determinant of the symmetric n X n matrix M defined by M(i,j) = tau(gcd(i,j)) for 1 <= i,j <= n (see De Koninck & Mercier reference). - Bernard Schott, Dec 08 2020

Examples

			1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + ...)))) = A001622.
1/9 = 0.11111111111111...
From _Wolfdieter Lang_, Feb 09 2012: (Start)
Modd 7 for nonnegative odd numbers not divisible by 3:
A007310: 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 37, ...
Modd 3:  1, 1, 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
(End)
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 186.
  • J.-M. De Koninck & A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 692 pp. 90 and 297, Ellipses, Paris, 2004.
  • Xavier Merlin, Méthodix Algèbre, Exercice 1-a), page 153, Ellipses, Paris, 1995.
  • 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 277, 284.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.
  • Paul Zeitz, The Art and Craft of Mathematical Problem Solving, The Great Courses, The Teaching Company, 2010 (DVDs and Course Guidebook, Lecture 6: "Pictures, Recasting, and Points of View", pp. 32-34).

Crossrefs

Programs

  • Haskell
    a000012 = const 1
    a000012_list = repeat 1 -- Reinhard Zumkeller, May 07 2012
    
  • Magma
    [1 : n in [0..100]];
    
  • Maple
    seq(1, i=0..150);
  • Mathematica
    Array[1 &, 50] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 26 2006 *)
  • Maxima
    makelist(1, n, 1, 30); /* Martin Ettl, Nov 07 2012 */
    
  • PARI
    {a(n) = 1};
    
  • Python
    print([1 for n in range(90)]) # Michael S. Branicky, Apr 04 2022

Formula

a(n) = 1.
G.f.: 1/(1-x).
E.g.f.: exp(x).
G.f.: Product_{k>=0} (1 + x^(2^k)). - Zak Seidov, Apr 06 2007
Completely multiplicative with a(p^e) = 1.
Regarded as a square array by antidiagonals, g.f. 1/((1-x)(1-y)), e.g.f. Sum T(n,m) x^n/n! y^m/m! = e^{x+y}, e.g.f. Sum T(n,m) x^n y^m/m! = e^y/(1-x). Regarded as a triangular array, g.f. 1/((1-x)(1-xy)), e.g.f. Sum T(n,m) x^n y^m/m! = e^{xy}/(1-x). - Franklin T. Adams-Watters, Feb 06 2006
Dirichlet g.f.: zeta(s). - Ilya Gutkovskiy, Aug 31 2016
a(n) = Sum_{l=1..n} (-1)^(l+1)*2*cos(Pi*l/(2*n+1)) = 1 identically in n >= 1 (for n=0 one has 0 from the undefined sum). From the Jolley reference, (429) p. 80. Interpretation: consider the n segments between x=0 and the n positive zeros of the Chebyshev polynomials S(2*n, x) (see A049310). Then the sum of the lengths of every other segment starting with the one ending in the largest zero (going from the right to the left) is 1. - Wolfdieter Lang, Sep 01 2016
As a lower triangular matrix, T = M*T^(-1)*M = M*A167374*M, where M(n,k) = (-1)^n A130595(n,k). Note that M = M^(-1). Cf. A118800 and A097805. - Tom Copeland, Nov 15 2016

A002450 a(n) = (4^n - 1)/3.

Original entry on oeis.org

0, 1, 5, 21, 85, 341, 1365, 5461, 21845, 87381, 349525, 1398101, 5592405, 22369621, 89478485, 357913941, 1431655765, 5726623061, 22906492245, 91625968981, 366503875925, 1466015503701, 5864062014805, 23456248059221, 93824992236885, 375299968947541
Offset: 0

Views

Author

Keywords

Comments

For n > 0, a(n) is the degree (n-1) "numbral" power of 5 (see A048888 for the definition of numbral arithmetic). Example: a(3) = 21, since the numbral square of 5 is 5(*)5 = 101(*)101(base 2) = 101 OR 10100 = 10101(base 2) = 21, where the OR is taken bitwise. - John W. Layman, Dec 18 2001
a(n) is composite for all n > 2 and has factors x, (3*x + 2*(-1)^n) where x belongs to A001045. In binary the terms greater than 0 are 1, 101, 10101, 1010101, etc. - John McNamara, Jan 16 2002
Number of n X 2 binary arrays with path of adjacent 1's from upper left corner to right column. - R. H. Hardin, Mar 16 2002
The Collatz-function iteration started at a(n), for n >= 1, will end at 1 after 2*n+1 steps. - Labos Elemer, Sep 30 2002 [corrected by Wolfdieter Lang, Aug 16 2021]
Second binomial transform of A001045. - Paul Barry, Mar 28 2003
All members of sequence are also generalized octagonal numbers (A001082). - Matthew Vandermast, Apr 10 2003
Also sum of squares of divisors of 2^(n-1): a(n) = A001157(A000079(n-1)), for n > 0. - Paul Barry, Apr 11 2003
Binomial transform of A000244 (with leading zero). - Paul Barry, Apr 11 2003
Number of walks of length 2n between two vertices at distance 2 in the cycle graph C_6. For n = 2 we have for example 5 walks of length 4 from vertex A to C: ABABC, ABCBC, ABCDC, AFABC and AFEDC. - Herbert Kociemba, May 31 2004
Also number of walks of length 2n + 1 between two vertices at distance 3 in the cycle graph C_12. - Herbert Kociemba, Jul 05 2004
a(n+1) is the number of steps that are made when generating all n-step random walks that begin in a given point P on a two-dimensional square lattice. To make one step means to mark one vertex on the lattice (compare A080674). - Pawel P. Mazur (Pawel.Mazur(AT)pwr.wroc.pl), Mar 13 2005
a(n+1) is the sum of square divisors of 4^n. - Paul Barry, Oct 13 2005
a(n+1) is the decimal number generated by the binary bits in the n-th generation of the Rule 250 elementary cellular automaton. - Eric W. Weisstein, Apr 08 2006
a(n-1) / a(n) = percentage of wasted storage if a single image is stored as a pyramid with a each subsequent higher resolution layer containing four times as many pixels as the previous layer. n is the number of layers. - Victor Brodsky (victorbrodsky(AT)gmail.com), Jun 15 2006
k is in the sequence if and only if C(4k + 1, k) (A052203) is odd. - Paul Barry, Mar 26 2007
This sequence also gives the number of distinct 3-colorings of the odd cycle C(2*n - 1). - Keith Briggs, Jun 19 2007
All numbers of the form m*4^m + (4^m-1)/3 have the property that they are sums of two squares and also their indices are the sum of two squares. This follows from the identity m*4^m + (4^m-1)/3 = 4(4(..4(4m + 1) + 1) + 1) + 1 ..) + 1. - Artur Jasinski, Nov 12 2007
For n > 0, terms are the numbers that, in base 4, are repunits: 1_4, 11_4, 111_4, 1111_4, etc. - Artur Jasinski, Sep 30 2008
Let A be the Hessenberg matrix of order n, defined by: A[1, j] = 1, A[i, i] := 5, (i > 1), A[i, i - 1] = -1, and A[i, j] = 0 otherwise. Then, for n >= 1, a(n) = charpoly(A,1). - Milan Janjic, Jan 27 2010
This is the sequence A(0, 1; 3, 4; 2) = A(0, 1; 4, 0; 1) of the family of sequences [a, b : c, d : k] considered by G. Detlefs, and treated as A(a, b; c, d; k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010
6*a(n) + 1 is every second Mersenne number greater than or equal to M3, hence all Mersenne primes greater than M2 must be a 6*a(n) + 1 of this sequence. - Roderick MacPhee, Nov 01 2010
Smallest number having alternating bit sum n. Cf. A065359.
For n = 1, 2, ..., the last digit of a(n) is 1, 5, 1, 5, ... . - Washington Bomfim, Jan 21 2011
Rule 50 elementary cellular automaton generates this sequence. This sequence also appears in the second column of array in A173588. - Paul Muljadi, Jan 27 2011
Sequence found by reading the line from 0, in the direction 0, 5, ... and the line from 1, in the direction 1, 21, ..., in the square spiral whose edges are the Jacobsthal numbers A001045 and whose vertices are the numbers A000975. These parallel lines are two semi-diagonals in the spiral. - Omar E. Pol, Sep 10 2011
a(n), n >= 1, is also the inverse of 3, denoted by 3^(-1), Modd(2^(2*n - 1)). For Modd n see a comment on A203571. E.g., a(2) = 5, 3 * 5 = 15 == 1 (Modd 8), because floor(15/8) = 1 is odd and -15 == 1 (mod 8). For n = 1 note that 3 * 1 = 3 == 1 (Modd 2) because floor(3/2) = 1 and -3 == 1 (mod 2). The inverse of 3 taken Modd 2^(2*n) coincides with 3^(-1) (mod 2^(2*n)) given in A007583(n), n >= 1. - Wolfdieter Lang, Mar 12 2012
If an AVL tree has a leaf at depth n, then the tree can contain no more than a(n+1) nodes total. - Mike Rosulek, Nov 20 2012
Also, this is the Lucas sequence V(5, 4). - Bruno Berselli, Jan 10 2013
Also, for n > 0, a(n) is an odd number whose Collatz trajectory contains no odd number other than n and 1. - Jayanta Basu, Mar 24 2013
Sum_{n >= 1} 1/a(n) converges to (3*(log(4/3) - QPolyGamma[0, 1, 1/4]))/log(4) = 1.263293058100271... = A321873. - K. G. Stier, Jun 23 2014
Consider n spheres in R^n: the i-th one (i=1, ..., n) has radius r(i) = 2^(1-i) and the coordinates of its center are (0, 0, ..., 0, r(i), 0, ..., 0) where r(i) is in position i. The coordinates of the intersection point in the positive orthant of these spheres are (2/a(n), 4/a(n), 8/a(n), 16/a(n), ...). For example in R^2, circles centered at (1, 0) and (0, 1/2), and with radii 1 and 1/2, meet at (2/5, 4/5). - Jean M. Morales, May 19 2015
From Peter Bala, Oct 11 2015: (Start)
a(n) gives the values of m such that binomial(4*m + 1,m) is odd. Cf. A003714, A048716, A263132.
2*a(n) = A020988(n) gives the values of m such that binomial(4*m + 2, m) is odd.
4*a(n) = A080674(n) gives the values of m such that binomial(4*m + 4, m) is odd. (End)
Collatz Conjecture Corollary: Except for powers of 2, the Collatz iteration of any positive integer must eventually reach a(n) and hence terminate at 1. - Gregory L. Simay, May 09 2016
Number of active (ON, black) cells at stage 2^n - 1 of the two-dimensional cellular automaton defined by "Rule 598", based on the 5-celled von Neumann neighborhood. - Robert Price, May 16 2016
From Luca Mariot and Enrico Formenti, Sep 26 2016: (Start)
a(n) is also the number of coprime pairs of polynomials (f, g) over GF(2) where both f and g have degree n + 1 and nonzero constant term.
a(n) is also the number of pairs of one-dimensional binary cellular automata with linear and bipermutive local rule of neighborhood size n+1 giving rise to orthogonal Latin squares of order 2^m, where m is a multiple of n. (End)
Except for 0, 1 and 5, all terms are Brazilian repunits numbers in base 4, and so belong to A125134. For n >= 3, all these terms are composite because a(n) = {(2^n-1) * (2^n + 1)}/3 and either (2^n - 1) or (2^n + 1) is a multiple of 3. - Bernard Schott, Apr 29 2017
Given the 3 X 3 matrix A = [2, 1, 1; 1, 2, 1; 1, 1, 2] and the 3 X 3 unit matrix I_3, A^n = a(n)(A - I_3) + I_3. - Nicolas Patrois, Jul 05 2017
The binary expansion of a(n) (n >= 1) consists of n 1's alternating with n - 1 0's. Example: a(4) = 85 = 1010101_2. - Emeric Deutsch, Aug 30 2017
a(n) (n >= 1) is the viabin number of the integer partition [n, n - 1, n - 2, ..., 2, 1] (for the definition of viabin number see comment in A290253). Example: a(4) = 85 = 1010101_2; consequently, the southeast border of the Ferrers board of the corresponding integer partition is ENENENEN, where E = (1, 0), N = (0, 1); this leads to the integer partition [4, 3, 2, 1]. - Emeric Deutsch, Aug 30 2017
Numbers whose binary and Gray-code representations are both palindromes (i.e., intersection of A006995 and A281379). - Amiram Eldar, May 17 2021
Starting with n = 1 the sequence satisfies {a(n) mod 6} = repeat{1, 5, 3}. - Wolfdieter Lang, Jan 14 2022
Terms >= 5 are those q for which the multiplicative order of 2 mod q is floor(log_2(q)) + 2 (and which is 1 more than the smallest possible order for any q). - Tim Seuré, Mar 09 2024
The order of 2 modulo a(n) is 2*n for n >= 2. - Joerg Arndt, Mar 09 2024

Examples

			Apply Collatz iteration to 9: 9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5 and hence 16, 8, 4, 2, 1.
Apply Collatz iteration to 27: 27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5 and hence 16, 8, 4, 2, 1. [Corrected by _Sean A. Irvine_ at the suggestion of Stephen Cornelius, Mar 04 2024]
a(5) = (4^5 - 1)/3 = 341 = 11111_4 = {(2^5 - 1) * (2^5 + 1)}/3 = 31 * 33/3 = 31 * 11. - _Bernard Schott_, Apr 29 2017
		

References

  • A. Fletcher, J. C. P. Miller, L. Rosenhead and L. J. Comrie, An Index of Mathematical Tables. Vols. 1 and 2, 2nd ed., Blackwell, Oxford and Addison-Wesley, Reading, MA, 1962, Vol. 1, p. 112.
  • J. Riordan, Combinatorial Identities, Wiley, 1968, p. 217.
  • 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

Partial sums of powers of 4, A000302.
When converted to binary, this gives A094028.
Subsequence of A003714.
Primitive factors: A129735.

Programs

  • GAP
    List([0..25], n -> (4^n-1)/3); # Muniru A Asiru, Feb 18 2018
    
  • Haskell
    a002450 = (`div` 3) . a024036
    a002450_list = iterate ((+ 1) . (* 4)) 0
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Magma
    [ (4^n-1)/3: n in [0..25] ]; // Klaus Brockhaus, Oct 28 2008
    
  • Magma
    [n le 2 select n-1 else 5*Self(n-1)-4*Self(n-2): n in [1..70]]; // Vincenzo Librandi, Jun 13 2015
    
  • Maple
    [seq((4^n-1)/3,n=0..40)];
    A002450:=1/(4*z-1)/(z-1); # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[(4^n - 1)/3, {n, 0, 127}] (* Vladimir Joseph Stephan Orlovsky, Sep 29 2008 *)
    LinearRecurrence[{5, -4}, {0, 1}, 30] (* Harvey P. Dale, Jun 23 2013 *)
  • Maxima
    makelist((4^n-1)/3, n, 0, 30); /* Martin Ettl, Nov 05 2012 */
    
  • PARI
    a(n) = (4^n-1)/3;
    
  • PARI
    my(z='z+O('z^40)); Vec(z/((1-z)*(1-4*z))) \\ Altug Alkan, Oct 11 2015
    
  • Python
    def A002450(n): return ((1<<(n<<1))-1)//3 # Chai Wah Wu, Jan 29 2023
  • Scala
    ((List.fill(20)(4: BigInt)).scanLeft(1: BigInt)( * )).scanLeft(0: BigInt)( + ) // Alonso del Arte, Sep 17 2019
    

Formula

From Wolfdieter Lang, Apr 24 2001: (Start)
a(n+1) = Sum_{m = 0..n} A060921(n, m).
G.f.: x/((1-x)*(1-4*x)). (End)
a(n) = Sum_{k = 0..n-1} 4^k; a(n) = A001045(2*n). - Paul Barry, Mar 17 2003
E.g.f.: (exp(4*x) - exp(x))/3. - Paul Barry, Mar 28 2003
a(n) = (A007583(n) - 1)/2. - N. J. A. Sloane, May 16 2003
a(n) = A000975(2*n)/2. - N. J. A. Sloane, Sep 13 2003
a(n) = A084160(n)/2. - N. J. A. Sloane, Sep 13 2003
a(n+1) = 4*a(n) + 1, with a(0) = 0. - Philippe Deléham, Feb 25 2004
a(n) = Sum_{i = 0..n-1} C(2*n - 1 - i, i)*2^i. - Mario Catalani (mario.catalani(AT)unito.it), Jul 23 2004
a(n+1) = Sum_{k = 0..n} binomial(n+1, k+1)*3^k. - Paul Barry, Aug 20 2004
a(n) = center term in M^n * [1 0 0], where M is the 3 X 3 matrix [1 1 1 / 1 3 1 / 1 1 1]. M^n * [1 0 0] = [A007583(n-1) a(n) A007583(n-1)]. E.g., a(4) = 85 since M^4 * [1 0 0] = [43 85 43] = [A007583(3) a(4) A007583(3)]. - Gary W. Adamson, Dec 18 2004
a(n) = Sum_{k = 0..n, j = 0..n} C(n, j)*C(j, k)*A001045(j - k). - Paul Barry, Feb 15 2005
a(n) = Sum_{k = 0..n} C(n, k)*A001045(n-k)*2^k = Sum_{k = 0..n} C(n, k)*A001045(k)*2^(n-k). - Paul Barry, Apr 22 2005
a(n) = A125118(n, 3) for n > 2. - Reinhard Zumkeller, Nov 21 2006
a(n) = Sum_{k = 0..n} 2^(n - k)*A128908(n, k), n >= 1. - Philippe Deléham, Oct 19 2008
a(n) = Sum_{k = 0..n} A106566(n, k)*A100335(k). - Philippe Deléham, Oct 30 2008
If we define f(m, j, x) = Sum_{k = j..m} binomial(m, k)*stirling2(k, j)*x^(m - k) then a(n-1) = f(2*n, 4, -2), n >= 2. - Milan Janjic, Apr 26 2009
a(n) = A014551(n) * A001045(n). - R. J. Mathar, Jul 08 2009
a(n) = 4*a(n-1) + a(n-2) - 4*a(n-3) = 5*a(n-1) - 4*a(n-2), a(0) = 0, a(1) = 1, a(2) = 5. - Wolfdieter Lang, Oct 18 2010
a(0) = 0, a(n+1) = a(n) + 2^(2*n). - Washington Bomfim, Jan 21 2011
A036555(a(n)) = 2*n. - Reinhard Zumkeller, Jan 28 2011
a(n) = Sum_{k = 1..floor((n+2)/3)} C(2*n + 1, n + 2 - 3*k). - Mircea Merca, Jun 25 2011
a(n) = Sum_{i = 1..n} binomial(2*n + 1, 2*i)/3. - Wesley Ivan Hurt, Mar 14 2015
a(n+1) = 2^(2*n) + a(n), a(0) = 0. - Ben Paul Thurston, Dec 27 2015
a(k*n)/a(n) = 1 + 4^n + ... + 4^((k-1)*n). - Gregory L. Simay, Jun 09 2016
Dirichlet g.f.: (PolyLog(s, 4) - zeta(s))/3. - Ilya Gutkovskiy, Jun 26 2016
A000120(a(n)) = n. - André Dalwigk, Mar 26 2018
a(m) divides a(m*n), in particular: a(2*n) == 0 (mod 5), a(3*n) == 0 (mod 3*7), a(5*n) == 0 (mod 11*31), etc. - M. F. Hasler, Oct 19 2018
a(n) = 4^(n-1) + a(n-1). - Bob Selcoe, Jan 01 2020
a(n) = A178415(1, n) = A347834(1, n-1), arrays, for n >= 1. - Wolfdieter Lang, Nov 29 2021
a(n) = A000225(2*n)/3. - John Keith, Jan 22 2022
a(n) = A080674(n) + 1 = A047849(n) - 1 = A163834(n) - 2 = A155701(n) - 3 = A163868(n) - 4 = A156605(n) - 7. - Ray Chandler, Jun 16 2023
From Peter Bala, Jul 23 2025: (Start)
The following are examples of telescoping products. Cf. A016153:
Product_{k = 1..2*n} 1 + 2^k/a(k+1) = a(n+1)/A007583(n) = (4^(n+1) - 1)/(2*4^n + 1).
Hence, Product_{k >= 1} 1 + 2^k/a(k+1) = 2.
Product_{k >= 1} 1 - 2^k/a(k+1) = 2/5, since 1 - 2^n/a(n+1) = b(n)/b(n-1), where b(n) = 2 - 3/(1 - 2^(n+1)).
Product_{k >= 1} 1 + (-2)^k/a(k+1) = 2/3, since 1 + (-2)^n/a(n+1) = c(n)/c(n-1), where c(n) = 2 - 1/(1 + (-2)^(n+1)).
Product_{k >= 1} 1 - (-2)^k/a(k+1) = 6/5, since 1 - (-2)^n/a(n+1) = d(n)/d(n-1), where d(n) = 2 - 1/(1 - (-2)^(n+1)). (End)

A027862 Primes of the form j^2 + (j+1)^2.

Original entry on oeis.org

5, 13, 41, 61, 113, 181, 313, 421, 613, 761, 1013, 1201, 1301, 1741, 1861, 2113, 2381, 2521, 3121, 3613, 4513, 5101, 7321, 8581, 9661, 9941, 10513, 12641, 13613, 14281, 14621, 15313, 16381, 19013, 19801, 20201, 21013, 21841, 23981, 24421, 26681
Offset: 1

Views

Author

Keywords

Comments

Also, primes of the form 4*k+1 which are the hypotenuse of one and only one right triangle with integral legs. - Cino Hilliard, Mar 16 2003
Centered square primes (i.e., prime terms of centered squares A001844). - Lekraj Beedassy, Jan 21 2005
Primes of the form 2*k*(k-1)+1. - Juri-Stepan Gerasimov, Apr 27 2010
Equivalently, primes of the form (m^2+1)/2 (take m=2*j+1). These primes a(n) have nontrivial solutions of x^2 == 1 (Modd a(n)) given by x=x(n)=A002731(n). For Modd n see a comment on A203571. See also A206549 for such solutions for primes of the form 4*k+1, given in A002144.
E.g., a(3)=41, A002731(3)=9, 9^2=81, floor(81/41)=1 (odd),
-81 = -2*41 + 1 == 1 (mod 2*41), hence 9^2 == 1 (Modd 41). - Wolfdieter Lang, Feb 24 2012
Also primes of the form 4*k+1 that are the smallest side length of one and only one integer Soddyian triangle (see A230812). - Frank M Jackson, Mar 13 2014
Also, primes of the form (m^2+1)/2. - Zak Seidov, May 01 2014
Note that ((2n+1)^2 + 1)/2 = n^2 + (n+1)^2. - Thomas Ordowski, May 25 2015
Primes p such that 2p-1 is a square. - Thomas Ordowski, Aug 27 2016
Primes in the main diagonal of A000027 when represented as an array read by antidiagonals. - Clark Kimberling, Mar 12 2023
The diophantine equation x^2 + ... + (x + r)^2 = p may be rewritten to A*x^2 + B*x + C = p, where A = (r + 1), B = r*(r + 1), C = r*(r + 1)*(2*r + 1)/6. If gcd(A, B, C) > 1 no solution for a prime p exists. The gcd(A, B, C) = 1 holds only for r = 1, 2, 5 (gcd is the greatest common divisor). For r = 1 we have x^2 + (x + 1)^2 = p, thus for x from A027861 we calculate primes p from A027862. For r = 2 we have x^2 + (x + 1)^2 + (x + 2)^2 = p, thus for x from A027863 we calculate primes p from A027864. For r = 5 we have x^2 + ... + (x + 5)^2 = p, thus for x from A027866 we calculate primes p from A027867. - Ctibor O. Zizka, Oct 04 2023

Examples

			13 is in the sequence because it is prime and 13 = 2^2 + 3^2. - _Michael B. Porter_, Aug 27 2016
		

References

  • D. M. Burton, Elementary Number Theory, Allyn and Bacon Inc. Boston, MA, 1976, p. 271.
  • Morris Kline, Mathematical Thought from Ancient to Modern Times, 1972. pp. 275.

Crossrefs

Primes p such that A079887(p) = 1.
Cf. A002731 (m values), A027861 (j values), A091277 (prime indices).
Subsequence of A002144 (p=4k+1).
Cf. A001844 (centered squares), A027863, A027864, A027866, A027867, A203571, A206549, A230812.

Programs

  • Magma
    [ a: n in [0..150] | IsPrime(a) where a is n^2+(n+1)^2 ]; // Vincenzo Librandi, Dec 18 2010
  • Mathematica
    Select[Table[n^2+(n+1)^2,{n,200}],PrimeQ] (* Harvey P. Dale, Aug 22 2012 *)
    Select[Total/@Partition[Range[200]^2,2,1],PrimeQ] (* Harvey P. Dale, Apr 20 2016 *)
  • PARI
    je=[]; for(n=1,500, if(isprime(n^2+(n+1)^2),je=concat(je,n^2+(n+1)^2))); je
    
  • PARI
    fermat(n) = { for(x=1,n, y=2*x*(x+1)+1; if(isprime(y),print1(y" ")) ) }
    

Formula

a(n) = ((A002731(n)^2 - 1)/2) + 1. - Torlach Rush, Mar 14 2014
a(n) = (A002731(n)^2 + 1)/2. - Zak Seidov, May 01 2014

Extensions

More terms from Cino Hilliard, Mar 16 2003

A002731 Numbers k such that (k^2 + 1)/2 is prime.

Original entry on oeis.org

3, 5, 9, 11, 15, 19, 25, 29, 35, 39, 45, 49, 51, 59, 61, 65, 69, 71, 79, 85, 95, 101, 121, 131, 139, 141, 145, 159, 165, 169, 171, 175, 181, 195, 199, 201, 205, 209, 219, 221, 231, 245, 261, 271, 275, 279, 289, 299, 309, 315, 321, 325, 329, 335, 345, 349, 371, 375, 379, 391, 399, 405
Offset: 1

Views

Author

Keywords

Comments

From Wolfdieter Lang, Feb 24 2012: (Start)
a(n) = sqrt(8*A129307(n)+1) = sqrt(2*A027862(n)-1), n >= 1.
a(n) is the nontrivial solution of the congruence a(n)^2 == 1 (Modd A027862(n)). The trivial one is +1. For Modd n see a comment on A203571. E.g., a(3)^2 = 81 == 1 (Modd 41), see a comment on A027862.
(End)

References

  • L. Euler, De numeris primis valde magnis (E283), reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 3, p. 24.
  • 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. A027861. A027862 gives primes, A091277 gives prime indices.

Programs

  • Haskell
    a002731 n = a002731_list !! (n-1)
    a002731_list = filter ((== 1) . a010051 . a000982) [1, 3 ..]
    -- Reinhard Zumkeller, Jul 13 2014
  • Magma
    [n: n in [3..410] | IsPrime((n^2+1) div 2) ]; // Vincenzo Librandi, Sep 25 2012
    
  • Mathematica
    Select[Range[400], PrimeQ[(#^2 + 1)/2] &] (* Alonso del Arte, Feb 24 2012 *)
  • PARI
    forstep(n=1,10^3,2, if(isprime((n^2+1)/2),print1(n,", ")));
    /* Joerg Arndt, Sep 02 2012 */
    

Formula

a(n) = 2*A027861(n) + 1.

A113807 Permutation of natural numbers generated by 7-rowed array shown below.

Original entry on oeis.org

1, 13, 2, 15, 12, 3, 27, 16, 11, 4, 29, 26, 17, 10, 5, 41, 30, 25, 18, 9, 6, 43, 40, 31, 24, 19, 8, 7, 55, 44, 39, 32, 23, 20, 14, 57, 54, 45, 38, 33, 22, 21, 69, 58, 53, 46, 37, 34, 28, 71, 68, 59, 52, 47, 36, 35, 83, 72, 67, 60, 51, 48, 42, 85, 82, 73, 66, 61, 50, 49
Offset: 1

Views

Author

Giovanni Teofilatto, Jan 22 2006

Keywords

Comments

For such arrays A_k see the k-family of 2k-periodic sequences P_k defined in a comment on A203571. There the k residue classes mod n have been defined. The present array is A_7 if the last class, starting with 7, is taken as first class [0] after adding a 0 in front. Then one obtains a permutation of the nonnegative integers. However, each complete residue class also includes its negative members. - Wolfdieter Lang, Feb 02 2012

Examples

			1 13 15 27 29 41 43 55 57 69 71 83 85 ... (A113801)
2 12 16 26 30 40 44 54 58 68 72 82 86 ... (A113802)
3 11 17 25 31 39 45 53 59 67 73 81 87 ... (A113803)
4 10 18 24 32 38 46 52 60 66 74 80 88 ... (A113804)
5  9 19 23 33 37 47 51 61 65 75 70 89 ... (A113805)
6  8 20 22 34 36 48 50 62 64 76 78 90 ... (A113806)
7 14 21 28 35 42 49 56 63 70 77 84 91 ... (A008589)
		

Crossrefs

Extensions

A-numbers added for array rows by Wolfdieter Lang, Dec 15 2011
More terms from Ray Chandler, Dec 15 2011

A084101 Expansion of (1+x)^2/((1-x)*(1+x^2)).

Original entry on oeis.org

1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1
Offset: 0

Views

Author

Paul Barry, May 15 2003

Keywords

Comments

Partial sums of A084099. Inverse binomial transform of A000749 (without leading zeros).
From Klaus Brockhaus, May 31 2010: (Start)
Periodic sequence: Repeat 1, 3, 3, 1.
Interleaving of A010684 and A176040.
Continued fraction expansion of (7 + 5*sqrt(29))/26.
Decimal expansion of 121/909.
a(n) = A143432(n+3) + 1 = 2*A021913(n+1) + 1 = 2*A133872(n+3) + 1.
a(n) = A165207(n+1) - 1.
First differences of A047538.
Binomial transform of A084102. (End)
From Wolfdieter Lang, Feb 09 2012: (Start)
a(n) = A045572(n+1) (Modd 5) := A203571(A045572(n+1)), n >= 0.
For general Modd n (not to be confused with mod n) see a comment on A203571. The nonnegative members of the five residue classes Modd 5, called [m] for m=0,1,...,4, are shown in the array A090298 if there the last row is taken as class [0] after inclusion of 0.
(End)

Examples

			From _Wolfdieter Lang_, Feb 09 2012: (Start)
Modd 5 of nonnegative odd numbers restricted mod 5:
A045572: 1, 3, 7, 9, 11, 13, 17, 19, 21, 23, ...
Modd 5:  1, 3, 3, 1,  1,  3,  3,  1,  1,  3, ...
(End)
		

Crossrefs

Cf. A084102.
Cf. A010684 (repeat 1, 3), A176040 (repeat 3, 1), A178593 (decimal expansion of (7+5*sqrt(29))/26), A143432 (expansion of (1+x^4)/((1-x)*(1+x^2))), A021913 (repeat 0, 0, 1, 1), A133872 (repeat 1, 1, 0, 0), A165207 (repeat 2, 2, 4, 4), A047538 (congruent to 0, 1, 4 or 7 mod 8), A084099 (expansion of (1+x)^2/(1+x^2)), A000749 (expansion of x^3/((1-x)^4-x^4)). - Klaus Brockhaus, May 31 2010

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 100); Coefficients(R!( (1+x)^2/((1-x)*(1+x^2)) )); // G. C. Greubel, Feb 28 2019
    
  • Mathematica
    CoefficientList[Series[(1+x)^2/((1-x)(1+x^2)),{x,0,110}],x] (* or *) PadRight[{},110,{1,3,3,1}] (* Harvey P. Dale, Nov 21 2012 *)
  • PARI
    x='x+O('x^100); Vec((1+x)^2/((1-x)*(1+x^2))) \\ Altug Alkan, Dec 24 2015
    
  • Sage
    ((1+x)^2/((1-x)*(1+x^2))).series(x, 100).coefficients(x, sparse=False) # G. C. Greubel, Feb 28 2019

Formula

a(n) = binomial(3, n mod 4). - Paul Barry, May 25 2003
From Klaus Brockhaus, May 31 2010: (Start)
a(n) = a(n-4) for n > 3; a(0) = a(3) = 1, a(1) = a(2) = 3.
a(n) = (4 - (1+i)*i^n - (1-i)*(-i)^n)/2 where i = sqrt(-1). (End)
E.g.f.: 2*exp(x) + sin(x) - cos(x). - Arkadiusz Wesolowski, Nov 04 2017
a(n) = 2 - (-1)^(n*(n+1)/2). - Guenther Schrack, Feb 26 2019

A206551 Moduli n for which the multiplicative group Modd n is cyclic.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 29, 31, 32, 33, 34, 35, 37, 38, 39, 41, 43, 45, 46, 47, 49, 50, 51, 53, 54, 55, 57, 58, 59, 61, 62, 64, 67, 69, 71, 73, 74, 75, 77, 79, 81, 82, 83, 86, 87, 89, 93, 94, 95, 97, 98, 99
Offset: 1

Views

Author

Wolfdieter Lang, Mar 27 2012

Keywords

Comments

For Modd n (not to be confused with mod n) see a comment on A203571.
For n=1 one has the Modd 1 residue class [0], the integers. The group of order 1 is the cyclic group Z_1 with the unit element 0==1 (Modd 1). [Changed by Wolfdieter Lang, Apr 04 2012]
For the non-cyclic (acyclic) values see A206552.
For these numbers n, and only for these (only the n values < 100 are shown above), there exist primitive roots Modd n. See the nonzero values of A206550 for the smallest positive ones.
For n=1 the primitive root is 0 == 1 (Modd 1), see above.
For n>=1 the multiplicative group Modd n is the Galois group Gal(Q(rho(n))/Q), with the algebraic number rho(n) := 2*cos(Pi/n) with minimal polynomial C(n,x), whose coefficients are given in A187360.

Examples

			a(2) = 2 for the multiplicative group Modd 2, with representative [1], and there is a primitive root, namely 1, because 1^1 = 1 == 1 (Modd 1). The cycle structure is [[1]], the group is Z_1.
a(3) = 3 for the multiplicative group Modd 3 which coincides with the one for Modd 2.
a(4) = 4 for the multiplicative group Modd 4 with representatives [1,3]. The smallest positive  primitive root is 3, because 3^2 == 1 (Modd 4). This group is cyclic, it is Z_2.
		

Crossrefs

Cf. A206550, A033948 (mod n case).

Formula

A206550(a(n)) > 0, n>=1.

A117444 Period 5: Repeat [0, 1, 2, -2, -1].

Original entry on oeis.org

0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0
Offset: 0

Views

Author

Paul Barry, Mar 16 2006

Keywords

Comments

See the comments in A203571 concerning formulas of the n-th term of periodic sequences. - M. F. Hasler, Jan 13 2013

Crossrefs

Cf. A061347.

Programs

Formula

G.f.: x*(1+3*x+x^2)/(1+x+x^2+x^3+x^4) = x*(1+2*x^2-2*x^3-x^4)/(1-x^5).
a(n) = (1/2)*Sum_{k=0..5} L(k*(k^2-n)/5), where L(j/p) is the Legendre symbol of j and p.
a(n) = sqrt(2+2/sqrt(5))*sin(2*Pi*n/5)-sqrt(2-2/sqrt(5))*sin(4*Pi*n/5).
a(n) = -2 + floor(23401/99999*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 03 2013
a(n) = -2 + floor(863/1562*5^(n+1)) mod 5. - Hieronymus Fischer, Jan 04 2013
a(n) = 2 - ((2-n) mod 5). - Wesley Ivan Hurt, Jul 12 2014
a(n) = - a(n-1) - a(n-2) - a(n-3) - a(n-4). - Wesley Ivan Hurt, Sep 05 2022

Extensions

More terms from Wesley Ivan Hurt, Jul 12 2014

A110551 Period 6: repeat [1, 3, 5, 5, 3, 1].

Original entry on oeis.org

1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 5, 3, 1
Offset: 0

Views

Author

Paul Barry, Jul 26 2005

Keywords

Comments

a(n) = A162699(n+1) (Modd 7) = A204453(A162699(n+1)), n>=0, where the nonnegative members of the seven residue classes Mod 7 (not to be confused with mod 7), called [m] for m=0..6, are given in the array A113807, if there the last row, starting with 7 is taken as class [0] after adding a 0 in front. Here only the classes [1], [3] and [5] are relevant. For Modd n residue classes see a comment on A203571. [Wolfdieter Lang, Feb 09 2012]
Continued fractions expansion of (8+sqrt(905))/29 = 1.3132144107925.. - R. J. Mathar, Mar 08 2012

Examples

			Modd 7 classes for positive odd numbers reduced mod 7: a(3)=5 because A162699(4)=9 (the fourth positive odd number not divisible by 7), and 9 is a member of the Modd 7 class [5] = {5,9,19,23,...}.
A162699: 1, 3, 5, 9, 11, 13, 15, 17, 19, 23, 25, 27,...
Modd 7:  1, 3, 5, 5,  3,  1,  1,  3,  5,  5,  3,  1,... [_Wolfdieter Lang_, Feb 09 2012]
		

Crossrefs

Programs

Formula

From R. J. Mathar, Oct 15 2014: (Start)
G.f.: ( 1+x+x^2 ) / ( (1-x)*(x^2-x+1) ).
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) for n>4.
a(n) = 3 + 2*sin(Pi*n/3)/sqrt(3) - 2*cos(Pi*n/3).
a(n) = A001045(n+2) mod 6. (End)
From Wesley Ivan Hurt, Jun 29 2016: (Start)
a(n) = a(n-6) for n>5.
a(n) = 2*a(n-1) - 2*a(n-2) + a(n-3) for n>2. (End)

A193680 Period 6 sequence 0,1,2,0,2,1.

Original entry on oeis.org

0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1
Offset: 0

Views

Author

Wolfdieter Lang, Sep 30 2011

Keywords

Comments

This sequence can be extended periodically to negative values of n.
See a comment on A203571 where a k-family of 2k-periodic sequences P_k has been defined. The present sequence is P_3. - Wolfdieter Lang, Feb 02 2012

Examples

			a(8) = 8(mod 3) = 2 because (-1)^floor(8/3)= +1; 8\3 = 2 is even.
a(4) = (3-4)(mod 3) = 2, because (-1)^floor(4/3) is -1; 4\3 = 1 is odd.
		

Crossrefs

Cf. signed versions A112300, A186809.

Programs

Formula

a(n) = n (mod 3) if (-1)^floor(n/3)=+1 else (3 - n)(mod 3), n>=0. (-1)^floor(n/3) is the parity of the quotient floor(n/3), sometimes denoted by n\3.
O.g.f.: x*(1+2*x+2*x^3+x^4)/(1-x^6).
a(n) = 1-((-1)^(n+1)+cos(Pi*n/3)+3*cos(2*Pi*n/3))/3. - R. J. Mathar, Oct 07 2011, corrected by Vaclav Kotesovec, Feb 19 2023
a(n) = floor((71/364)*3^(n+1)) mod 3. - Hieronymus Fischer, Jan 04 2013
a(n) = floor((4007/333333)*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 04 2013
From Amiram Eldar, Jan 01 2023: (Start)
Multiplicative with a(2^e) = 2, a(3^e) = 0, and a(p^e) = 1 for p >= 5.
Dirichlet g.f.: zeta(s)*(1+1/2^s-1/3^s-1/6^s). (End)

Extensions

Keyword:mult added by Andrew Howroyd, Jul 31 2018
Showing 1-10 of 44 results. Next