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

A130519 a(n) = Sum_{k=0..n} floor(k/4). (Partial sums of A002265.)

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 4, 6, 8, 10, 12, 15, 18, 21, 24, 28, 32, 36, 40, 45, 50, 55, 60, 66, 72, 78, 84, 91, 98, 105, 112, 120, 128, 136, 144, 153, 162, 171, 180, 190, 200, 210, 220, 231, 242, 253, 264, 276, 288, 300, 312, 325, 338, 351, 364, 378, 392, 406, 420, 435, 450
Offset: 0

Views

Author

Hieronymus Fischer, Jun 01 2007

Keywords

Comments

Complementary to A130482 with respect to triangular numbers, in that A130482(n) + 4*a(n) = n(n+1)/2 = A000217(n).
Disregarding the first three 0's the resulting sequence a'(n) is the sum of the positive integers <= n that have the same residue modulo 4 as n. This is the additive counterpart of the quadruple factorial numbers. - Peter Luschny, Jul 06 2011
From Heinrich Ludwig, Dec 23 2017: (Start)
Column sums of (shift of rows = 4):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...
1 2 3 4 5 6 7 8 9 10 ...
1 2 3 4 5 6 ...
1 2 ...
.......................................
---------------------------------------
1 2 3 4 6 8 10 12 15 18 21 24 28 32 ...
shift of rows = 1 see A000217
shift of rows = 2 see A002620
shift of rows = 3 see A001840
shift of rows = 5 see A130520
(End)
Conjecture: a(n+2) is the maximum effective weight of a numerical semigroup S of genus n (see Nathan Pflueger). - Stefano Spezia, Jan 04 2019

Examples

			G.f. = x^4 + 2*x^5 + 3*x^6 + 4*x^7 + 6*x^8 + 8*x^9 + 10*x^10 + 12*x^11 + ...
[ n] a(n)
---------
[ 4] 1
[ 5] 2
[ 6] 3
[ 7] 4
[ 8] 1 + 5
[ 9] 2 + 6
[10] 3 + 7
[11] 4 + 8
		

Crossrefs

Programs

  • GAP
    a:=List([0..65],n->Sum([0..n],k->Int(k/4)));; Print(a); # Muniru A Asiru, Jan 04 2019
    
  • Magma
    [Round(n*(n-2)/8): n in [0..70]]; // Vincenzo Librandi, Jun 25 2011
    
  • Maple
    quadsum := n -> add(k, k = select(k -> k mod 4 = n mod 4, [$1 .. n])):
    A130519 := n ->`if`(n<3,0,quadsum(n-3)); seq(A130519(n),n=0..58); # Peter Luschny, Jul 06 2011
  • Mathematica
    a[ n_] := Quotient[ (n - 1)^2, 8]; (* Michael Somos, Oct 14 2011 *)
  • Maxima
    makelist(floor((n-1)^2/8), n, 0, 70); /* Stefano Spezia, Jan 04 2019 */
    
  • PARI
    {a(n) = (n - 1)^2 \ 8}; /* Michael Somos, Oct 14 2011 */
    
  • Python
    def A130519(n): return (n-1)**2>>3  # Chai Wah Wu, Jul 30 2022

Formula

G.f.: x^4/((1-x^4)*(1-x)^2) = x^4/((1+x)*(1+x^2)*(1-x)^3).
a(n) = +2*a(n-1) -1*a(n-2) +1*a(n-4) -2*a(n-5) +1*a(n-6).
a(n) = floor(n/4)*(n - 1 - 2*floor(n/4)) = A002265(n)*(n - 1 - 2*A002265(n)).
a(n) = (1/2)*A002265(n)*(n - 2 + A010873(n)).
a(n) = floor((n-1)^2/8). - Mitch Harris, Sep 08 2008
a(n) = round(n*(n-2)/8) = round((n^2-2*n-1)/8) = ceiling((n+1)*(n-3)/8). - Mircea Merca, Nov 28 2010
a(n) = A001972(n-4), n>3. - Franklin T. Adams-Watters, Jul 10 2009
a(n) = a(n-4)+n-3, n>3. - Mircea Merca, Nov 28 2010
Euler transform of length 4 sequence [ 2, 0, 0, 1]. - Michael Somos, Oct 14 2011
a(n) = a(2-n) for all n in Z. - Michael Somos, Oct 14 2011
a(n) = A214734(n, 1, 4). - Renzo Benedetti, Aug 27 2012
a(4n) = A000384(n), a(4n+1) = A001105(n), a(4n+2) = A014105(n), a(4n+3) = A046092(n). - Philippe Deléham, Mar 26 2013
a(n) = Sum_{i=1..ceiling(n/2)-1} (i mod 2) * (n - 2*i - 1). - Wesley Ivan Hurt, Jan 23 2014
a(n) = ( 2*n^2-4*n-1+(-1)^n+2*((-1)^((2*n-1+(-1)^n)/4)-(-1)^((6*n-1+(-1)^n)/4)) )/16 = ( 2*n*(n-2) - (1-(-1)^n)*(1-2*i^(n*(n-1))) )/16, where i=sqrt(-1). - Luce ETIENNE, Aug 29 2014
E.g.f.: (1/8)*((- 1 + x)*x*cosh(x) + 2*sin(x) + (- 1 - x + x^2)*sinh(x)). - Stefano Spezia, Jan 15 2019
a(n) = (A002620(n-1) - A011765(n+1)) / 2, for n > 0. - Yuchun Ji, Feb 05 2021
Sum_{n>=4} 1/a(n) = Pi^2/12 + 5/2. - Amiram Eldar, Aug 13 2022

Extensions

Partially edited by R. J. Mathar, Jul 11 2009

A004526 Nonnegative integers repeated, floor(n/2).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of elements in the set {k: 1 <= 2k <= n}.
Dimension of the space of weight 2n+4 cusp forms for Gamma_0(2).
Dimension of the space of weight 1 modular forms for Gamma_1(n+1).
Number of ways 2^n is expressible as r^2 - s^2 with s > 0. Proof: (r+s) and (r-s) both should be powers of 2, even and distinct hence a(2k) = a(2k-1) = (k-1) etc. - Amarnath Murthy, Sep 20 2002
Lengths of sides of Ulam square spiral; i.e., lengths of runs of equal terms in A063826. - Donald S. McDonald, Jan 09 2003
Number of partitions of n into two parts. A008619 gives partitions of n into at most two parts, so A008619(n) = a(n) + 1 for all n >= 0. Partial sums are A002620 (Quarter-squares). - Rick L. Shepherd, Feb 27 2004
a(n+1) is the number of 1's in the binary expansion of the Jacobsthal number A001045(n). - Paul Barry, Jan 13 2005
Number of partitions of n+1 into two distinct (nonzero) parts. Example: a(8) = 4 because we have [8,1],[7,2],[6,3] and [5,4]. - Emeric Deutsch, Apr 14 2006
Complement of A000035, since A000035(n)+2*a(n) = n. Also equal to the partial sums of A000035. - Hieronymus Fischer, Jun 01 2007
Number of binary bracelets of n beads, two of them 0. For n >= 2, a(n-2) is the number of binary bracelets of n beads, two of them 0, with 00 prohibited. - Washington Bomfim, Aug 27 2008
Let A be the Hessenberg n X n matrix defined by: A[1,j] = j mod 2, A[i,i]:=1, A[i,i-1] = -1, and A[i,j] = 0 otherwise. Then, for n >= 1, a(n+1) = (-1)^n det(A). - Milan Janjic, Jan 24 2010
From Clark Kimberling, Mar 10 2011: (Start)
Let RT abbreviate rank transform (A187224). Then
RT(this sequence) = A187484;
RT(this sequence without 1st term) = A026371;
RT(this sequence without 1st 2 terms) = A026367;
RT(this sequence without 1st 3 terms) = A026363. (End)
The diameter (longest path) of the n-cycle. - Cade Herron, Apr 14 2011
For n >= 3, a(n-1) is the number of two-color bracelets of n beads, three of them are black, having a diameter of symmetry. - Vladimir Shevelev, May 03 2011
Pelesko (2004) refers erroneously to this sequence instead of A008619. - M. F. Hasler, Jul 19 2012
Number of degree 2 irreducible characters of the dihedral group of order 2(n+1). - Eric M. Schmidt, Feb 12 2013
For n >= 3 the sequence a(n-1) is the number of non-congruent regions with infinite area in the exterior of a regular n-gon with all diagonals drawn. See A217748. - Martin Renner, Mar 23 2013
a(n) is the number of partitions of 2n into exactly 2 even parts. a(n+1) is the number of partitions of 2n into exactly 2 odd parts. This just rephrases the comment of E. Deutsch above. - Wesley Ivan Hurt, Jun 08 2013
Number of the distinct rectangles and square in a regular n-gon is a(n/2) for even n and n >= 4. For odd n, such number is zero, see illustration in link. - Kival Ngaokrajang, Jun 25 2013
x-coordinate from the image of the point (0,-1) after n reflections across the lines y = n and y = x respectively (alternating so that one reflection is applied on each step): (0,-1) -> (0,1) -> (1,0) -> (1,2) -> (2,1) -> (2,3) -> ... . - Wesley Ivan Hurt, Jul 12 2013
a(n) is the number of partitions of 2n into exactly two distinct odd parts. a(n-1) is the number of partitions of 2n into exactly two distinct even parts, n > 0. - Wesley Ivan Hurt, Jul 21 2013
a(n) is the number of permutations of length n avoiding 213, 231 and 312, or avoiding 213, 312 and 321 in the classical sense which are breadth-first search reading words of increasing unary-binary trees. For more details, see the entry for permutations avoiding 231 at A245898. - Manda Riehl, Aug 05 2014
Also a(n) is the number of different patterns of 2-color, 2-partition of n. - Ctibor O. Zizka, Nov 19 2014
Minimum in- and out-degree for a directed K_n (see link). - Jon Perry, Nov 22 2014
a(n) is also the independence number of the triangular graph T(n). - Luis Manuel Rivera Martínez, Mar 12 2015
For n >= 3, a(n+4) is the least positive integer m such that every m-element subset of {1,2,...,n} contains distinct i, j, k with i + j = k (equivalently, with i - j = k). - Rick L. Shepherd, Jan 24 2016
More generally, the ordinary generating function for the integers repeated k times is x^k/((1 - x)(1 - x^k)). - Ilya Gutkovskiy, Mar 21 2016
a(n) is the number of numbers of the form F(i)*F(j) between F(n+3) and F(n+4), where 2 < i < j and F = A000045 (Fibonacci numbers). - Clark Kimberling, May 02 2016
The arithmetic function v_2(n,2) as defined in A289187. - Robert Price, Aug 22 2017
a(n) is also the total domination number of the (n-3)-gear graph. - Eric W. Weisstein, Apr 07 2018
Consider the numbers 1, 2, ..., n; a(n) is the largest integer t such that these numbers can be arranged in a row so that all consecutive terms differ by at least t. Example: a(6) = a(7) = 3, because of respectively (4, 1, 5, 2, 6, 3) and (1, 5, 2, 6, 3, 7, 4) (see link BMO - Problem 2). - Bernard Schott, Mar 07 2020
a(n-1) is also the number of integer-sided triangles whose sides a < b < c are in arithmetic progression with a middle side b = n (see A307136). Example, for b = 4, there exists a(3) = 1 such triangle corresponding to Pythagorean triple (3, 4, 5). For the triples, miscellaneous properties and references, see A336750. - Bernard Schott, Oct 15 2020
For n >= 1, a(n-1) is the greatest remainder on division of n by any k in 1..n. - David James Sycamore, Sep 05 2021
Number of incongruent right triangles that can be formed from the vertices of a regular n-gon is given by a(n/2) for n even. For n odd such number is zero. For a regular n-gon, the number of incongruent triangles formed from its vertices is given by A069905(n). The number of incongruent acute triangles is given by A005044(n). The number of incongruent obtuse triangles is given by A008642(n-4) for n > 3 otherwise 0, with offset 0. - Frank M Jackson, Nov 26 2022
The inverse binomial transform is 0, 0, 1, -2, 4, -8, 16, -32, ... (see A122803). - R. J. Mathar, Feb 25 2023

Examples

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

References

  • G. L. Alexanderson et al., The William Powell Putnam Mathematical Competition - Problems and Solutions: 1965-1984, M.A.A., 1985; see Problem A-1 of 27th Competition.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 120, P(n,2).
  • Graham, Knuth and Patashnik, Concrete Mathematics, Addison-Wesley, NY, 1989, page 77 (partitions of n into at most 2 parts).

Crossrefs

a(n+2) = A008619(n). See A008619 for more references.
A001477(n) = a(n+1)+a(n). A000035(n) = a(n+1)-A002456(n).
a(n) = A008284(n, 2), n >= 1.
Zero followed by the partial sums of A000035.
Column 2 of triangle A094953. Second row of A180969.
Partial sums: A002620. Other related sequences: A010872, A010873, A010874.
Cf. similar sequences of the integers repeated k times: A001477 (k = 1), this sequence (k = 2), A002264 (k = 3), A002265 (k = 4), A002266 (k = 5), A152467 (k = 6), A132270 (k = 7), A132292 (k = 8), A059995 (k = 10).
Cf. A289187, A139756 (binomial transf).

Programs

  • Haskell
    a004526 = (`div` 2)
    a004526_list = concatMap (\x -> [x, x]) [0..]
    -- Reinhard Zumkeller, Jul 27 2012
    
  • Magma
    [Floor(n/2): n in [0..100]]; // Vincenzo Librandi, Nov 19 2014
    
  • Maple
    A004526 := n->floor(n/2); seq(floor(i/2),i=0..50);
  • Mathematica
    Table[(2n - 1)/4 + (-1)^n/4, {n, 0, 70}] (* Stefan Steinerberger, Apr 02 2006 *)
    f[n_] := If[OddQ[n], (n - 1)/2, n/2]; Array[f, 74, 0] (* Robert G. Wilson v, Apr 20 2012 *)
    With[{c=Range[0,40]},Riffle[c,c]] (* Harvey P. Dale, Aug 26 2013 *)
    CoefficientList[Series[x^2/(1 - x - x^2 + x^3), {x, 0, 75}], x] (* Robert G. Wilson v, Feb 05 2015 *)
    LinearRecurrence[{1, 1, -1}, {0, 0, 1}, 75] (* Robert G. Wilson v, Feb 05 2015 *)
    Floor[Range[0, 40]/2] (* Eric W. Weisstein, Apr 07 2018 *)
  • Maxima
    makelist(floor(n/2),n,0,50); /* Martin Ettl, Oct 17 2012 */
    
  • PARI
    a(n)=n\2 /* Jaume Oliver Lafont, Mar 25 2009 */
    
  • PARI
    x='x+O('x^100); concat([0, 0], Vec(x^2/((1+x)*(x-1)^2))) \\ Altug Alkan, Mar 21 2016
    
  • Python
    def a(n): return n//2
    print([a(n) for n in range(74)]) # Michael S. Branicky, Apr 30 2022
  • Sage
    def a(n) : return( dimension_cusp_forms( Gamma0(2), 2*n+4) ); # Michael Somos, Jul 03 2014
    
  • Sage
    def a(n) : return( dimension_modular_forms( Gamma1(n+1), 1) ); # Michael Somos, Jul 03 2014
    

Formula

G.f.: x^2/((1+x)*(x-1)^2).
a(n) = floor(n/2).
a(n) = ceiling((n+1)/2). - Eric W. Weisstein, Jan 11 2024
a(n) = 1 + a(n-2).
a(n) = a(n-1) + a(n-2) - a(n-3).
a(2*n) = a(2*n+1) = n.
a(n+1) = n - a(n). - Henry Bottomley, Jul 25 2001
For n > 0, a(n) = Sum_{i=1..n} (1/2)/cos(Pi*(2*i-(1-(-1)^n)/2)/(2*n+1)). - Benoit Cloitre, Oct 11 2002
a(n) = (2*n-1)/4 + (-1)^n/4; a(n+1) = Sum_{k=0..n} k*(-1)^(n+k). - Paul Barry, May 20 2003
E.g.f.: ((2*x-1)*exp(x) + exp(-x))/4. - Paul Barry, Sep 03 2003
G.f.: (1/(1-x)) * Sum_{k >= 0} t^2/(1-t^4) where t = x^2^k. - Ralf Stephan, Feb 24 2004
a(n+1) = A000120(A001045(n)). - Paul Barry, Jan 13 2005
a(n) = (n-(1-(-1)^n)/2)/2 = (1/2)*(n-|sin(n*Pi/2)|). Likewise: a(n) = (n-A000035(n))/2. Also: a(n) = Sum_{k=0..n} A000035(k). - Hieronymus Fischer, Jun 01 2007
The expression floor((x^2-1)/(2*x)) (x >= 1) produces this sequence. - Mohammad K. Azarian, Nov 08 2007; corrected by M. F. Hasler, Nov 17 2008
a(n+1) = A002378(n) - A035608(n). - Reinhard Zumkeller, Jan 27 2010
a(n+1) = A002620(n+1) - A002620(n) = floor((n+1)/2)*ceiling((n+1)/2) - floor(n^2/4). - Jonathan Vos Post, May 20 2010
For n >= 2, a(n) = floor(log_2(2^a(n-1) + 2^a(n-2))). - Vladimir Shevelev, Jun 22 2010
a(n) = A180969(2,n). - Adriano Caroli, Nov 24 2010
A001057(n-1) = (-1)^n*a(n), n > 0. - M. F. Hasler, Jul 19 2012
a(n) = A008615(n) + A002264(n). - Reinhard Zumkeller, Apr 28 2014
Euler transform of length 2 sequence [1, 1]. - Michael Somos, Jul 03 2014

Extensions

Partially edited by Joerg Arndt, Mar 11 2010, and M. F. Hasler, Jul 19 2012

A010888 Digital root of n (repeatedly add the digits of n until a single digit is reached).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5
Offset: 0

Views

Author

Keywords

Comments

This is sometimes also called the additive digital root of n.
n mod 9 (A010878) is a very similar sequence.
Partial sums are given by A130487(n-1) + n (for n > 0). - Hieronymus Fischer, Jun 08 2007
Decimal expansion of 13717421/111111111 is 0.123456789123456789123456789... with period 9. - Eric Desbiaux, May 19 2008
Decimal expansion of 13717421 / 1111111110 = 0.0[123456789] (periodic) - Daniel Forgues, Feb 27 2017
a(A005117(n)) < 9. - Reinhard Zumkeller, Mar 30 2010
My friend Jahangeer Kholdi has found that 19 is the smallest prime p such that for each number n, a(p*n) = a(n). In fact we have: a(m*n) = a(a(m)*a(n)) so all numbers with digital root 1 (numbers of the form 9k + 1) have this property. See comment lines of A017173. Also we have a(m+n) = a(a(m) + a(n)). - Farideh Firoozbakht, Jul 23 2010

Examples

			The digits of 37 are 3 and 7, and 3 + 7 = 10. And the digits of 10 are 1 and 0, and 1 + 0 = 1, so a(37) = 1.
		

References

  • Martin Gardner, Mathematics, Magic and Mystery, 1956.

Crossrefs

Cf. A007953, A007954, A031347, A113217, A113218, A010878 (n mod 9), A010872, A010873, A010874, A010875, A010876, A010877, A010879, A004526, A002264, A002265, A002266, A017173, A031286 (additive persistence of n), (multiplicative digital root of n), A031346 (multiplicative persistence of n).

Programs

Formula

If n = 0 then a(n) = 0; otherwise a(n) = (n reduced mod 9), but if the answer is 0 change it to 9.
Equivalently, if n = 0 then a(n) = 0, otherwise a(n) = (n - 1 reduced mod 9) + 1.
If the initial 0 term is ignored, the sequence is periodic with period 9.
From Hieronymus Fischer, Jun 08 2007: (Start)
a(n) = A010878(n-1) + 1 (for n > 0).
G.f.: g(x) = x*(Sum_{k = 0..8}(k+1)*x^k)/(1 - x^9). Also: g(x) = x(9x^10 - 10x^9 + 1)/((1 - x^9)(1 - x)^2). (End)
a(n) = n - 9*floor((n-1)/9), for n > 0. - José de Jesús Camacho Medina, Nov 10 2014

A005044 Alcuin's sequence: expansion of x^3/((1-x^2)*(1-x^3)*(1-x^4)).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 2, 1, 3, 2, 4, 3, 5, 4, 7, 5, 8, 7, 10, 8, 12, 10, 14, 12, 16, 14, 19, 16, 21, 19, 24, 21, 27, 24, 30, 27, 33, 30, 37, 33, 40, 37, 44, 40, 48, 44, 52, 48, 56, 52, 61, 56, 65, 61, 70, 65, 75, 70, 80, 75, 85, 80, 91, 85, 96, 91, 102, 96, 108, 102, 114, 108, 120
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of triangles with integer sides and perimeter n.
Also a(n) is the number of triangles with distinct integer sides and perimeter n+6, i.e., number of triples (a, b, c) such that 1 < a < b < c < a+b, a+b+c = n+6. - Roger Cuculière
With a different offset (i.e., without the three leading zeros, as in A266755), the number of ways in which n empty casks, n casks half-full of wine and n full casks can be distributed to 3 persons in such a way that each one gets the same number of casks and the same amount of wine [Alcuin]. E.g., for n=2 one can give 2 people one full and one empty and the 3rd gets two half-full. (Comment corrected by Franklin T. Adams-Watters, Oct 23 2006)
For m >= 2, the sequence {a(n) mod m} is periodic with period 12*m. - Martin J. Erickson (erickson(AT)truman.edu), Jun 06 2008
Number of partitions of n into parts 2, 3, and 4, with at least one part 3. - Joerg Arndt, Feb 03 2013
For several values of p and q the sequence (A005044(n+p) - A005044(n-q)) leads to known sequences, see the crossrefs. - Johannes W. Meijer, Oct 12 2013
For n>=3, number of partitions of n-3 into parts 2, 3, and 4. - David Neil McGrath, Aug 30 2014
Also, a(n) is the number of partitions mu of n of length 3 such that mu_1-mu_2 is even and mu_2-mu_3 is even (see below example). - John M. Campbell, Jan 29 2016
For n > 1, number of triangles with odd side lengths and perimeter 2*n-3. - Wesley Ivan Hurt, May 13 2019
Number of partitions of n+1 into 4 parts whose largest two parts are equal. - Wesley Ivan Hurt, Jan 06 2021
For n>=3, number of weak partitions of n-3 (that is, allowing parts of size 0) into three parts with no part exceeding (n-3)/2. Also, number of weak partitions of n-3 into three parts, all of the same parity as n-3. - Kevin Long, Feb 20 2021
Also, a(n) is the number of incongruent acute triangles formed from the vertices of a regular n-gon. - Frank M Jackson, Nov 04 2022

Examples

			There are 4 triangles of perimeter 11, with sides 1,5,5; 2,4,5; 3,3,5; 3,4,4. So a(11) = 4.
G.f. = x^3 + x^5 + x^6 + 2*x^7 + x^8 + 3*x^9 + 2*x^10 + 4*x^11 + 3*x^12 + ...
From _John M. Campbell_, Jan 29 2016: (Start)
Letting n = 15, there are a(n)=7 partitions mu |- 15 of length 3 such that mu_1-mu_2 is even and mu_2-mu_3 is even:
(13,1,1) |- 15
(11,3,1) |- 15
(9,5,1) |- 15
(9,3,3) |- 15
(7,7,1) |- 15
(7,5,3) |- 15
(5,5,5) |- 15
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 74, Problem 7.
  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. Wiley, NY, Chap.10, Section 10.2, Problems 5 and 6, pp. 451-2.
  • D. Olivastro: Ancient Puzzles. Classic Brainteasers and Other Timeless Mathematical Games of the Last 10 Centuries. New York: Bantam Books, 1993. See p. 158.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. M. Yaglom and I. M. Yaglom: Challenging Mathematical Problems with Elementary Solutions. Vol. I. Combinatorial Analysis and Probability Theory. New York: Dover Publications, Inc., 1987, p. 8, #30 (First published: San Francisco: Holden-Day, Inc., 1964)

Crossrefs

See A266755 for a version without the three leading zeros.
Both bisections give (essentially) A001399.
(See the comments.) Cf. A008615 (p=1, q=3, offset=0), A008624 (3, 3, 0), A008679 (3, -1, 0), A026922 (1, 5, 1), A028242 (5, 7, 0), A030451 (6, 6, 0), A051274 (3, 5, 0), A052938 (8, 4, 0), A059169 (0, 6, 1), A106466 (5, 4, 0), A130722 (2, 7, 0)
Cf. this sequence (k=3), A288165 (k=4), A288166 (k=5).
Number of k-gons that can be formed with perimeter n: this sequence (k=3), A062890 (k=4), A069906 (k=5), A069907 (k=6), A288253 (k=7), A288254 (k=8), A288255 (k=9), A288256 (k=10).

Programs

  • Haskell
    a005044 = p [2,3,4] . (subtract 3) where
    p _ 0 = 1
    p [] _ = 0
    p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Feb 28 2013
  • Maple
    A005044 := n-> floor((1/48)*(n^2+3*n+21+(-1)^(n-1)*3*n)): seq(A005044(n), n=0..73);
    A005044 := -1/(z**2+1)/(z**2+z+1)/(z+1)**2/(z-1)**3; # Simon Plouffe in his 1992 dissertation
  • Mathematica
    a[n_] := Round[If[EvenQ[n], n^2, (n + 3)^2]/48] (* Peter Bertok, Jan 09 2002 *)
    CoefficientList[Series[x^3/((1 - x^2)*(1 - x^3)*(1 - x^4)), {x, 0, 105}], x] (* Robert G. Wilson v, Jun 02 2004 *)
    me[n_] := Module[{i, j, sum = 0}, For[i = Ceiling[(n - 3)/3], i <= Floor[(n - 3)/2], i = i + 1, For[j = Ceiling[(n - i - 3)/2], j <= i, j = j + 1, sum = sum + 1] ]; Return[sum]; ] mine = Table[me[n], {n, 1, 11}]; (* Srikanth (sriperso(AT)gmail.com), Aug 02 2008 *)
    LinearRecurrence[{0,1,1,1,-1,-1,-1,0,1},{0,0,0,1,0,1,1,2,1},80] (* Harvey P. Dale, Sep 22 2014 *)
    Table[Length@Select[IntegerPartitions[n, {3}], Max[#]*180 < 90 n &], {n, 1, 100}] (* Frank M Jackson, Nov 04 2022 *)
  • PARI
    a(n) = round(n^2 / 12) - (n\2)^2 \ 4
    
  • PARI
    a(n) = (n^2 + 6*n * (n%2) + 24) \ 48
    
  • PARI
    a(n)=if(n%2,n+3,n)^2\/48 \\ Charles R Greathouse IV, May 02 2016
    
  • PARI
    concat(vector(3), Vec((x^3)/((1-x^2)*(1-x^3)*(1-x^4)) + O(x^70))) \\ Felix Fröhlich, Jun 07 2017
    

Formula

a(n) = a(n-6) + A059169(n) = A070093(n) + A070101(n) + A024155(n).
For odd indices we have a(2*n-3) = a(2*n). For even indices, a(2*n) = nearest integer to n^2/12 = A001399(n).
For all n, a(n) = round(n^2/12) - floor(n/4)*floor((n+2)/4) = a(-3-n) = A069905(n) - A002265(n)*A002265(n+2).
For n = 0..11 (mod 12), a(n) is respectively n^2/48, (n^2 + 6*n - 7)/48, (n^2 - 4)/48, (n^2 + 6*n + 21)/48, (n^2 - 16)/48, (n^2 + 6*n - 7)/48, (n^2 + 12)/48, (n^2 + 6*n + 5)/48, (n^2 - 16)/48, (n^2 + 6*n + 9)/48, (n^2 - 4)/48, (n^2 + 6*n + 5)/48.
Euler transform of length 4 sequence [ 0, 1, 1, 1]. - Michael Somos, Sep 04 2006
a(-3 - n) = a(n). - Michael Somos, Sep 04 2006
a(n) = sum(ceiling((n-3)/3) <= i <= floor((n-3)/2), sum(ceiling((n-i-3)/2) <= j <= i, 1 ) ) for n >= 1. - Srikanth K S, Aug 02 2008
a(n) = a(n-2) + a(n-3) + a(n-4) - a(n-5) - a(n-6) - a(n-7) + a(n-9) for n >= 9. - David Neil McGrath, Aug 30 2014
a(n+3) = a(n) if n is odd; a(n+3) = a(n) + floor(n/4) + 1 if n is even. Sketch of proof: There is an obvious injective map from perimeter-n triangles to perimeter-(n+3) triangles defined by f(a,b,c) = (a+1,b+1,c+1). It is easy to show f is surjective for odd n, while for n=2k the image of f is only missing the triangles (a,k+2-a,k+1) for 1 <= a <= floor(k/2)+1. - James East, May 01 2016
a(n) = round(n^2/48) if n is even; a(n) = round((n+3)^2/48) if n is odd. - James East, May 01 2016
a(n) = (6*n^2 + 18*n - 9*(-1)^n*(2*n + 3) - 36*sin(Pi*n/2) - 36*cos(Pi*n/2) + 64*cos(2*Pi*n/3) - 1)/288. - Ilya Gutkovskiy, May 01 2016
a(n) = A325691(n-3) + A000035(n) for n>=3. The bijection between partition(n,[2,3,4]) and not-over-half partition(n,3,n/2) + partition(n,2,n/2) can be built by a Ferrers(part)[0+3,1,2] map. And the last partition(n,2,n/2) is unique [n/2,n/2] if n is even, it is given by A000035. - Yuchun Ji, Sep 24 2020
a(4n+3) = a(4n) + n+1, a(4n+4) = a(4n+1) = A000212(n+1), a(4n+5) = a(4n+2) + n+1, a(4n+6) = a(4n+3) = A007980(n). - Yuchun Ji, Oct 10 2020
a(n)-a(n-4) = A008615(n-1). - R. J. Mathar, Jun 23 2021
a(n)-a(n-2) = A008679(n-3). - R. J. Mathar, Jun 23 2021

Extensions

Additional comments from Reinhard Zumkeller, May 11 2002
Yaglom reference and mod formulas from Antreas P. Hatzipolakis (xpolakis(AT)otenet.gr), May 27 2000
The reference to Alcuin of York (735-804) was provided by Hermann Kremer (hermann.kremer(AT)onlinehome.de), Jun 18 2004

A010873 a(n) = n mod 4.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Complement of A002265, since 4*A002265(n)+a(n) = n. - Hieronymus Fischer, Jun 01 2007
The rightmost digit in the base-4 representation of n. Also, the equivalent value of the two rightmost digits in the base-2 representation of n. - Hieronymus Fischer, Jun 11 2007
Periodic sequences of this type can be also calculated by a(n) = floor(q/(p^m-1)*p^n) mod p, where q is the number representing the periodic digit pattern and m is the period length. p and q can be calculated as follows: Let D be the array representing the number pattern to be repeated, m = size of D, max = maximum value of elements in D. Than p := max + 1 and q := p^m*sum_{i=1..m} D(i)/p^i. Example: D = (0, 1, 2, 3), p = 4 and q = 57 for this sequence. - Hieronymus Fischer, Jan 04 2013

Crossrefs

Partial sums: A130482. Other related sequences A130481, A130483, A130484, A130485.

Programs

Formula

a(n) = (1/2)*(3-(-1)^n-2*(-1)^floor(n/2));
also a(n) = (1/2)*(3-(-1)^n-2*(-1)^((2*n-1+(-1)^n)/4));
also a(n) = (1/2)*(3-(-1)^n-2*sin(Pi/4*(2n+1+(-1)^n))).
G.f.: (3x^3+2x^2+x)/(1-x^4). - Hieronymus Fischer, May 29 2007
From Hieronymus Fischer, Jun 11 2007: (Start)
Trigonometric representation: a(n)=2^2*(sin(n*Pi/4))^2*sum{1<=k<4, k*product{1<=m<4,m<>k, (sin((n-m)*Pi/4))^2}}. Clearly, the squared terms may be replaced by their absolute values '|.|'.
Complex representation: a(n)=1/4*(1-r^n)*sum{1<=k<4, k*product{1<=m<4,m<>k, (1-r^(n-m))}} where r=exp(Pi/2*i)=i=sqrt(-1). All these formulas can be easily adapted to represent any periodic sequence.
a(n) = n mod 2+2*(floor(n/2)mod 2) = A000035(n)+2*A000035(A004526(n)). (End)
a(n) = 6 - a(n-1) - a(n-2) - a(n-3) for n > 2. - Reinhard Zumkeller, Apr 13 2008
a(n) = 3/2 + cos((n+1)*Pi)/2 + sqrt(2)*cos((2*n+3)*Pi/4). - Jaume Oliver Lafont, Dec 05 2008
From Hieronymus Fischer, Jan 04 2013: (Start)
a(n) = floor(41/3333*10^(n+1)) mod 10.
a(n) = floor(19/85*4^(n+1)) mod 4. (End)
E.g.f.: 2*sinh(x) - sin(x) + cosh(x) - cos(x). - Stefano Spezia, Apr 20 2021
From Nicolas Bělohoubek, May 30 2024: (Start)
a(n) = (2*a(n-1)-1)*(2-a(n-2)) for n > 1.
a(n) = (2*a(n-1)^2+1)*(3-a(n-1))/3 for n > 0. (End)

Extensions

First to third formulas re-edited for better readability by Hieronymus Fischer, Dec 05 2011
Incorrect g.f. removed by Georg Fischer, May 18 2019

A002264 Nonnegative integers repeated 3 times.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25
Offset: 0

Views

Author

Keywords

Comments

Complement of A010872, since A010872(n) + 3*a(n) = n. - Hieronymus Fischer, Jun 01 2007
Chvátal proved that, given an arbitrary n-gon, there exist a(n) points such that all points in the interior are visible from at least one of those points; further, for all n >= 3, there exists an n-gon which cannot be covered in this fashion with fewer than a(n) points. This is known as the "art gallery problem". - Charles R Greathouse IV, Aug 29 2012
The inverse binomial transform is 0, 0, 0, 1, -3, 6, -9, 9, 0, -27, 81, -162, 243, -243, 0, 729,.. (see A000748). - R. J. Mathar, Feb 25 2023

Crossrefs

Partial sums give A130518.
Cf. A004523 interlaced with A004396.
Apart from the zeros, this is column 3 of A235791.

Programs

  • Haskell
    a002264 n = a002264_list !! n
    a002264_list = 0 : 0 : 0 : map (+ 1) a002264_list
    -- Reinhard Zumkeller, Nov 06 2012, Apr 16 2012
    
  • Magma
    [Floor(n/3): n in [0..100]]; // Vincenzo Librandi, Apr 29 2015
    
  • Magma
    &cat [[n,n,n]: n in [0..30]]; // Bruno Berselli, Apr 29 2015
  • Maple
    seq(i$3,i=0..100); # Robert Israel, Aug 04 2014
  • Mathematica
    Flatten[Table[{n, n, n}, {n, 0, 25}]] (* Harvey P. Dale, Jun 09 2013 *)
    Floor[Range[0, 20]/3] (* Eric W. Weisstein, Aug 12 2023 *)
    Table[Floor[n/3], {n, 0, 20}] (* Eric W. Weisstein, Aug 12 2023 *)
    Table[(n - Cos[2 (n - 2) Pi/3] + Sin[2 (n - 2) Pi/3]/Sqrt[3] - 1)/3, {n, 0, 20}] (* Eric W. Weisstein, Aug 12 2023 *)
    Table[(n - ChebyshevU[n - 2, -1/2] - 1)/3, {n, 0, 20}] (* Eric W. Weisstein, Aug 12 2023 *)
    LinearRecurrence[{1, 0, 1, -1}, {0, 0, 0, 1}, 20] (* Eric W. Weisstein, Aug 12 2023 *)
    CoefficientList[Series[x^3/((-1 + x)^2 (1 + x + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Aug 12 2023 *)
  • PARI
    a(n)=n\3  /* Jaume Oliver Lafont, Mar 25 2009 */
    
  • PARI
    v=[0,0];for(n=2,50,v=concat(v,n-2-v[#v]-v[#v-1]));v \\ Derek Orr, Apr 28 2015
    
  • Sage
    [floor(n/3) for n in range(0,79)] # Zerinvary Lajos, Dec 01 2009
    

Formula

a(n) = floor(n/3).
a(n) = (3*n-3-sqrt(3)*(1-2*cos(2*Pi*(n-1)/3))*sin(2*Pi*(n-1)/3))/9. - Hieronymus Fischer, Sep 18 2007
a(n) = (n - A010872(n))/3. - Hieronymus Fischer, Sep 18 2007
Complex representation: a(n) = (n - (1 - r^n)*(1 + r^n/(1 - r)))/3 where r = exp(2*Pi/3*i) = (-1 + sqrt(3)*i)/2 and i = sqrt(-1). - Hieronymus Fischer, Sep 18 2007; - corrected by Guenther Schrack, Sep 26 2019
a(n) = Sum_{k=0..n-1} A022003(k). - Hieronymus Fischer, Sep 18 2007
G.f.: x^3/((1-x)*(1-x^3)). - Hieronymus Fischer, Sep 18 2007
a(n) = (n - 1 + 2*sin(4*(n+2)*Pi/3)/sqrt(3))/3. - Jaume Oliver Lafont, Dec 05 2008
For n >= 3, a(n) = floor(log_3(3^a(n-1) + 3^a(n-2) + 3^a(n-3))). - Vladimir Shevelev, Jun 22 2010
a(n) = (n - 3 + A010872(n-1) + A010872(n-2))/3 using Zumkeller's 2008 formula in A010872. - Adriano Caroli, Nov 23 2010
a(n) = A004526(n) - A008615(n). - Reinhard Zumkeller, Apr 28 2014
a(2*n) = A004523(n) and a(2*n+1) = A004396(n). - L. Edson Jeffery, Jul 30 2014
a(n) = n - 2 - a(n-1) - a(n-2) for n > 1 with a(0) = a(1) = 0. - Derek Orr, Apr 28 2015
From Wesley Ivan Hurt, May 27 2015: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4), n > 4.
a(n) = (n - 1 + 0^((-1)^(n/3) - (-1)^n) - 0^((-1)^(n/3)*(-1)^(1/3) + (-1)^n))/3. (End)
a(n) = (3*n - 3 + r^n*(1 - r) + r^(2*n)*(r + 2))/9 where r = (-1 + sqrt(-3))/2. - Guenther Schrack, Sep 26 2019
E.g.f.: exp(x)*(x - 1)/3 + exp(-x/2)*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2))/9. - Stefano Spezia, Oct 17 2022

A010872 a(n) = n mod 3.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Fixed point of morphism 0 -> 01, 1 -> 20, 2 -> 12.
Complement of A002264, since 3*A002264(n) + a(n) = n. - Hieronymus Fischer, Jun 01 2007
Decimal expansion of 4/333. - Elmo R. Oliveira, Feb 19 2024
Period 3: repeat [0, 1, 2]. - Elmo R. Oliveira, Jun 20 2024

Examples

			G.f. = x + 2*x^2 + x^4 + 2*x^5 + x^7 + 2*x^8 + x^10 + 2*x^11 + x^13 + ...
		

Crossrefs

Cf. A010882, A130481 (partial sums), A131555.
Other related sequences are A130482, A130483, A130484, A130485.

Programs

  • Haskell
    a010872 = (`mod` 3)
    a010872_list = cycle [0,1,2]  -- Reinhard Zumkeller, May 26 2012
    
  • Magma
    [n mod 3 : n in [0..100]]; // Wesley Ivan Hurt, May 27 2015
    
  • Maple
    A010872:=n->(n mod 3): seq(A010872(n), n=0..100); # Wesley Ivan Hurt, May 27 2015
  • Mathematica
    Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 1}, 1 -> {2, 0}, 2 -> {1, 2}})]}], {0}, 7] (* Robert G. Wilson v, Feb 28 2005 *)
    PadRight[{},120,{0,1,2}] (* or *) Mod[Range[0,120],3] (* Harvey P. Dale, Jul 20 2025 *)
  • PARI
    my(x='x+O('x^200)); concat(0, Vec((2*x^2+x)/(1-x^3))) \\ Altug Alkan, Mar 23 2016

Formula

a(n) = n - 3*floor(n/3) = a(n-3).
G.f.: (2*x^2+x)/(1-x^3). - Mario Catalani (mario.catalani(AT)unito.it), Jan 08 2003
From Hieronymus Fischer, May 29 2007: (Start)
a(n) = 1 + (1-2*cos(2*Pi*(n-1)/3)) * sin(2*Pi*(n-1)/3) / sqrt(3).
a(n) = (1-r^n)*(1+r^n/(1-r)) where r=exp(2*Pi*i/3)=(-1+sqrt(3)*i)/2 and i=sqrt(-1). [corrected by Guenther Schrack, Sep 23 2019] (End)
From Hieronymus Fischer, Jun 01 2007: (Start)
a(n) = (16/9)*((sin(Pi*(n-2)/3))^2+2*(sin(Pi*(n-1)/3))^2)*(sin(Pi*n/3))^2.
a(n) = (4/3)*(|sin(Pi*(n-2)/3)|+2*|sin(Pi*(n-1)/3)|)*|sin(Pi*n/3)|.
a(n) = (4/9)*((1-cos(2*Pi*(n-2)/3))+2*(1-cos(2*Pi*(n-1)/3)))*(1-cos(2*Pi*n/3)). (End)
a(n) = 3 - a(n-1) - a(n-2) for n > 1. - Reinhard Zumkeller, Apr 13 2008
a(n) = 1-2*sin(4*Pi*(n+2)/3)/sqrt(3). - Jaume Oliver Lafont, Dec 05 2008
From Wesley Ivan Hurt, May 27 2015, Mar 22 2016: (Start)
a(n) = 1 - 0^((-1)^(n/3)-(-1)^n) + 0^((-1)^((n+1)/3)+(-1)^n).
a(n) = 1 + (-1)^((2*n+4)/3)/3 + (-1)^((-2*n-4)/3)/3 + 2*(-1)^((2*n+2)/3)/3 + 2*(-1)^((-2*n-2)/3)/3.
a(n) = 1 + 2*cos(Pi*(2*n+4)/3)/3 + 4*cos(Pi*(2*n+2)/3)/3. (End)
a(n) = (r^n*(r-1) - r^(2*n)*(r + 2) + 3)/3 where r = (-1 + sqrt(-3))/2. - Guenther Schrack, Sep 23 2019
E.g.f.: exp(x) - exp(-x/2)*(cos(sqrt(3)*x/2) + sin(sqrt(3)*x/2)/sqrt(3)). - Stefano Spezia, Mar 01 2020
a(n) = A010882(n) - 1 = A131555(2*n) = A131555(2*n+1). - Elmo R. Oliveira, Jun 25 2024
From Nicolas Bělohoubek, May 26 2025: (Start)
a(n) = (3*a(n-1)+1)*(2-a(n-1))/2 for n > 0.
a(n) = (2*a(n-1)-4)/(3*a(n-1)-4) for n > 0. (End)

Extensions

Edited by Joerg Arndt, Apr 21 2014

A046034 Numbers whose digits are primes.

Original entry on oeis.org

2, 3, 5, 7, 22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 222, 223, 225, 227, 232, 233, 235, 237, 252, 253, 255, 257, 272, 273, 275, 277, 322, 323, 325, 327, 332, 333, 335, 337, 352, 353, 355, 357, 372, 373, 375, 377, 522, 523, 525, 527, 532
Offset: 1

Views

Author

Keywords

Comments

If n is represented as a zerofree base-4 number (see A084544) according to n=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j=0..m} c(d(j))*10^j, where c(k)=2,3,5,7 for k=1..4. - Hieronymus Fischer, May 30 2012
According to A153025, it seems that 5, 235 and 72335 are the only terms whose square is also a term, i.e., which are also in the sequence A275971 of square roots of the terms which are squares, listed in A191486. - M. F. Hasler, Sep 16 2016

Examples

			a(100)   = 2277,
a(10^3)  = 55327,
a(9881)  = 3233232,
a(10^4)  = 3235757,
a(10922) = 3333333,
a(10^5)  = 227233257.
		

Crossrefs

Programs

  • Haskell
    a046034 n = a046034_list !! (n-1)
    a046034_list = filter (all (`elem` "2357") . show ) [0..]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Magma
    [n: n in [2..532] | Set(Intseq(n)) subset [2, 3, 5, 7]];  // Bruno Berselli, Jul 19 2011
    
  • Mathematica
    Table[FromDigits /@ Tuples[{2, 3, 5, 7}, n], {n, 3}] // Flatten (* Michael De Vlieger, Sep 19 2016 *)
  • PARI
    is_A046034(n)=Set(isprime(digits(n)))==[1] \\ M. F. Hasler, Oct 12 2013
    
  • Python
    def A046034(n):
        m = (3*n+1).bit_length()-1>>1
        return int(''.join(('2357'[(3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3] for j in range(m)))) # Chai Wah Wu, Feb 08 2023

Formula

A055642(a(n)) = A193238(a(n)). - Reinhard Zumkeller, Jul 19 2011
From Hieronymus Fischer, Apr 20, May 30 and Jun 25 2012: (Start)
a(n) = Sum_{j=0..m-1} ((2*b(j)+1) mod 8 + floor(b(j)/4) - floor((b(j)-1)/4))*10^j, where m = floor(log_4(3*n+1)), b(j) = floor((3*n+1-4^m)/(3*4^j)).
a(n) = Sum_{j=0..m-1} A010877(A005408(b(j)) + A002265(b(j)) - A002265(b(j)-1))*10^j.
Special values:
a(1*(4^n-1)/3) = 2*(10^n-1)/9.
a(2*(4^n-1)/3) = 1*(10^n-1)/3.
a(3*(4^n-1)/3) = 5*(10^n-1)/9.
a(4*(4^n-1)/3) = 7*(10^n-1)/9.
Inequalities:
a(n) <= 2*(10^log_4(3*n+1)-1)/9, equality holds for n = (4^k-1)/3, k>0.
a(n) <= 2*A084544(n), equality holds iff all digits of A084544(n) are 1.
a(n) > A084544(n).
Lower and upper limits:
lim inf a(n)/10^log_4(n) = (7/90)*10^log_4(3) = 0.48232167706987..., for n -> oo.
lim sup a(n)/10^log_4(n) = (2/9)*10^log_4(3) = 1.378061934485343..., for n -> oo.
where 10^log_4(n) = n^1.66096404744...
G.f.: g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(2 + z(j) + 2*z(j)^2 + 2*z(j)^3 - 7*z(j)^4)/(1-z(j)^4), where z(j) = x^4^j.
Also g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(1-z(j))*(2 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3)/(1-z(j)^4), where z(j)=x^4^j.
Also: g(x) = (1/(1-x))*(2*h_(4,0)(x) + h_(4,1)(x) + 2*h_(4,2)(x) + 2*h_(4,3)(x) - 7*h_(4,4)(x)), where h_(4,k)(x) = Sum_{j>=0} 10^j*x^((4^(j+1)-1)/3)*x^(k*4^j)/(1-x^4^(j+1)). (End)
Sum_{n>=1} 1/a(n) = 1.857333779940977502574887651449435985318556794733869779170825138954093657197... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

Extensions

More terms from Cino Hilliard, Aug 06 2006
Typo in second formula corrected by Hieronymus Fischer, May 12 2012
Two typos in example section corrected by Hieronymus Fischer, May 30 2012

A010874 a(n) = n mod 5.

Original entry on oeis.org

0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0
Offset: 0

Views

Author

Keywords

Comments

Complement of A002266, since 5*A002266(n) + a(n) = n. - Hieronymus Fischer, Jun 01 2007

Crossrefs

Programs

Formula

Complex representation: a(n) = (1/5)*(1-r^n)*Sum{1<=k<5, k*Product{1<=m<5,m<>k, (1-r^(n-m))}} where r=exp(2*Pi/5*i) and i=sqrt(-1).
G.f.: g(x)=(4*x^4+3*x^3+2*x^2+x)/(1-x^5). - Hieronymus Fischer, May 29 2007
Trigonometric representation: a(n) = (16/5)^2*(sin(n*Pi/5))^2*Sum{1<=k<5, k*Product{1<=m<5,m<>k, (sin((n-m)*Pi/5))^2}}. Clearly, the squared terms may be replaced by their absolute values '|.|'. This formula can be easily adapted to represent any periodic sequence.
G.f.: also g(x) = x*(5*x^6 - 6*x^5 + 1)/((1-x^5)*(1-x)^2). - Hieronymus Fischer, Jun 01 2007
a(n) = -cos(4/5*Pi*n)-cos(2/5*Pi*n)+1/20*5^(1/2)*(10-2*5^(1/2))^(1/2)* sin(4/5*Pi*n)-1/4*(10-2*5^(1/2))^(1/2)*sin(4/5*Pi*n)-1/4*(10+2*5^(1/2))^(1/2)*sin(2/5*Pi*n)-1/20*5^(1/2)*(10+2*5^(1/2))^(1/2)*sin(2/5*Pi*n) + 2. - Leonid Bedratyuk, May 14 2012
a(n) = floor(1234/99999*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 03 2013
a(n) = floor(97/1562*5^(n+1)) mod 5. - Hieronymus Fischer, Jan 04 2013
From Wesley Ivan Hurt, Jul 23 2016: (Start)
a(n) = a(n-5) for n>4.
a(n) = 4*(1 - floor(n/5)) + Sum_{k=1..4} floor((n-k)/5).
a(n) = 4 - 4*floor(n/5) + floor((n-1)/5) + floor((n-2)/5) + floor((n-3)/5) + floor((n-4)/5).
a(n) = n - 5*floor(n/5). (End)
a(n) = 2 + (2/5)*Sum_{k=1..4} k*(cos(2*(n-k)*Pi/5) + cos(4*(n-k)*Pi/5)). - Wesley Ivan Hurt, Sep 27 2018

A374848 Obverse convolution A000045**A000045; see Comments.

Original entry on oeis.org

0, 1, 2, 16, 162, 3600, 147456, 12320100, 2058386904, 701841817600, 488286500625000, 696425232679321600, 2038348954317776486400, 12259459134020160144810000, 151596002479762016373851690400, 3855806813438155578522841251840000
Offset: 0

Views

Author

Clark Kimberling, Jul 31 2024

Keywords

Comments

The obverse convolution of sequences
s = (s(0), s(1), ...) and t = (t(0), t(1), ...)
is introduced here as the sequence s**t given by
s**t(n) = (s(0)+t(n)) * (s(1)+t(n-1)) * ... * (s(n)+t(0)).
Swapping * and + in the representation s(0)*t(n) + s(1)*t(n-1) + ... + s(n)*t(0)
of ordinary convolution yields s**t.
If x is an indeterminate or real (or complex) variable, then for every sequence t of real (or complex) numbers, s**t is a sequence of polynomials p(n) in x, and the zeros of p(n) are the numbers -t(0), -t(1), ..., -t(n).
Following are abbreviations in the guide below for triples (s, t, s**t):
F = (0,1,1,2,3,5,...) = A000045, Fibonacci numbers
L = (2,1,3,4,7,11,...) = A000032, Lucas numbers
P = (2,3,5,7,11,...) = A000040, primes
T = (1,3,6,10,15,...) = A000217, triangular numbers
C = (1,2,6,20,70, ...) = A000984, central binomial coefficients
LW = (1,3,4,6,8,9,...) = A000201, lower Wythoff sequence
UW = (2,5,7,10,13,...) = A001950, upper Wythoff sequence
[ ] = floor
In the guide below, sequences s**t are identified with index numbers Axxxxxx; in some cases, s**t and Axxxxxx differ in one or two initial terms.
Table 1. s = A000012 = (1,1,1,1...) = (1);
t = A000012; 1 s**t = A000079; 2^(n+1)
t = A000027; n s**t = A000142; (n+1)!
t = A000040, P s**t = A054640
t = A000040, P (1/3) s**t = A374852
t = A000079, 2^n s**t = A028361
t = A000079, 2^n (1/3) s**t = A028362
t = A000045, F s**t = A082480
t = A000032, L s**t = A374890
t = A000201, LW s**t = A374860
t = A001950, UW s**t = A374864
t = A005408, 2*n+1 s**t = A000165, 2^n*n!
t = A016777, 3*n+1 s**t = A008544
t = A016789, 3*n+2 s**t = A032031
t = A000142, n! s**t = A217757
t = A000051, 2^n+1 s**t = A139486
t = A000225, 2^n-1 s**t = A006125
t = A032766, [3*n/2] s**t = A111394
t = A034472, 3^n+1 s**t = A153280
t = A024023, 3^n-1 s**t = A047656
t = A000217, T s**t = A128814
t = A000984, C s**t = A374891
t = A279019, n^2-n s**t = A130032
t = A004526, 1+[n/2] s**t = A010551
t = A002264, 1+[n/3] s**t = A264557
t = A002265, 1+[n/4] s**t = A264635
Sequences (c)**L, for c=2..4: A374656 to A374661
Sequences (c)**F, for c=2..6: A374662, A374662, A374982 to A374855
The obverse convolutions listed in Table 1 are, trivially, divisibility sequences. Likewise, if s = (-1,-1,-1,...) instead of s = (1,1,1,...), then s**t is a divisibility sequence for every choice of t; e.g. if s = (-1,-1,-1,...) and t = A279019, then s**t = A130031.
Table 2. s = A000027 = (0,1,2,3,4,5,...) = (n);
t = A000027, n s**t = A007778, n^(n+1)
t = A000290, n^2 s**t = A374881
t = A000040, P s**t = A374853
t = A000045, F s**t = A374857
t = A000032, L s**t = A374858
t = A000079, 2^n s**t = A374859
t = A000201, LW s**t = A374861
t = A005408, 2*n+1 s**t = A000407, (2*n+1)! / n!
t = A016777, 3*n+1 s**t = A113551
t = A016789, 3*n+2 s**t = A374866
t = A000142, n! s**t = A374871
t = A032766, [3*n/2] s**t = A374879
t = A000217, T s**t = A374892
t = A000984, C s**t = A374893
t = A038608, n*(-1)^n s**t = A374894
Table 3. s = A000290 = (0,1,4,9,16,...) = (n^2);
t = A000290, n^2 s**t = A323540
t = A002522, n^2+1 s**t = A374884
t = A000217, T s**t = A374885
t = A000578, n^3 s**t = A374886
t = A000079, 2^n s**t = A374887
t = A000225, 2^n-1 s**t = A374888
t = A005408, 2*n+1 s**t = A374889
t = A000045, F s**t = A374890
Table 4. s = t;
s = t = A000012, 1 s**s = A000079; 2^(n+1)
s = t = A000027, n s**s = A007778, n^(n+1)
s = t = A000290, n^2 s**s = A323540
s = t = A000045, F s**s = this sequence
s = t = A000032, L s**s = A374850
s = t = A000079, 2^n s**s = A369673
s = t = A000244, 3^n s**s = A369674
s = t = A000040, P s**s = A374851
s = t = A000201, LW s**s = A374862
s = t = A005408, 2*n+1 s**s = A062971
s = t = A016777, 3*n+1 s**s = A374877
s = t = A016789, 3*n+2 s**s = A374878
s = t = A032766, [3*n/2] s**s = A374880
s = t = A000217, T s**s = A375050
s = t = A005563, n^2-1 s**s = A375051
s = t = A279019, n^2-n s**s = A375056
s = t = A002398, n^2+n s**s = A375058
s = t = A002061, n^2+n+1 s**s = A375059
If n = 2*k+1, then s**s(n) is a square; specifically,
s**s(n) = ((s(0)+s(n))*(s(1)+s(n-1))*...*(s(k)+s(k+1)))^2.
If n = 2*k, then s**s(n) has the form 2*s(k)*m^2, where m is an integer.
Table 5. Others
s = A000201, LW t = A001950, UW s**t = A374863
s = A000045, F t = A000032, L s**t = A374865
s = A005843, 2*n t = A005408, 2*n+1 s**t = A085528, (2*n+1)^(n+1)
s = A016777, 3*n+1 t = A016789, 3*n+2 s**t = A091482
s = A005408, 2*n+1 t = A000045, F s**t = A374867
s = A005408, 2*n+1 t = A000032, L s**t = A374868
s = A005408, 2*n+1 t = A000079, 2^n s**t = A374869
s = A000027, n t = A000142, n! s**t = A374871
s = A005408, 2*n+1 t = A000142, n! s**t = A374872
s = A000079, 2^n t = A000142, n! s**t = A374874
s = A000142, n! t = A000045, F s**t = A374875
s = A000142, n! t = A000032, L s**t = A374876
s = A005408, 2*n+1 t = A016777, 3*n+1 s**t = A352601
s = A005408, 2*n+1 t = A016789, 3*n+2 s**t = A064352
Table 6. Arrays of coefficients of s(x)**t(x), where s(x) and t(x) are polynomials
s(x) t(x) s(x)**t(x)
n x A132393
n^2 x A269944
x+1 x+1 A038220
x+2 x+2 A038244
x x+3 A038220
nx x+1 A094638
1 x^2+x+1 A336996
n^2 x x+1 A375041
n^2 x 2x+1 A375042
n^2 x x+2 A375043
2^n x x+1 A375044
2^n 2x+1 A375045
2^n x+2 A375046
x+1 F(n) A375047
x+1 x+F(n) A375048
x+F(n) x+F(n) A375049

Examples

			a(0) = 0 + 0 = 0
a(1) = (0+1) * (1+0) = 1
a(2) = (0+1) * (1+1) * (1+0) = 2
a(3) = (0+2) * (1+1) * (1+1) * (2+0) = 16
As noted above, a(2*k+1) is a square for k>=0. The first 5 squares are 1, 16, 3600, 12320100, 701841817600, with corresponding square roots 1, 4, 60, 3510, 837760.
If n = 2*k, then s**s(n) has the form 2*F(k)*m^2, where m is an integer and F(k) is the k-th Fibonacci number; e.g., a(6) = 2*F(3)*(192)^2.
		

Crossrefs

Programs

  • Maple
    a:= n-> (F-> mul(F(n-j)+F(j), j=0..n))(combinat[fibonacci]):
    seq(a(n), n=0..15);  # Alois P. Heinz, Aug 02 2024
  • Mathematica
    s[n_] := Fibonacci[n]; t[n_] := Fibonacci[n];
    u[n_] := Product[s[k] + t[n - k], {k, 0, n}];
    Table[u[n], {n, 0, 20}]
  • PARI
    a(n)=prod(k=0, n, fibonacci(k) + fibonacci(n-k)) \\ Andrew Howroyd, Jul 31 2024

Formula

a(n) ~ c * phi^(3*n^2/4 + n) / 5^((n+1)/2), where c = QPochhammer(-1, 1/phi^2)^2/2 if n is even and c = phi^(1/4) * QPochhammer(-phi, 1/phi^2)^2 / (phi + 1)^2 if n is odd, and phi = A001622 is the golden ratio. - Vaclav Kotesovec, Aug 01 2024
Showing 1-10 of 99 results. Next