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

A038754 a(2n) = 3^n, a(2n+1) = 2*3^n.

Original entry on oeis.org

1, 2, 3, 6, 9, 18, 27, 54, 81, 162, 243, 486, 729, 1458, 2187, 4374, 6561, 13122, 19683, 39366, 59049, 118098, 177147, 354294, 531441, 1062882, 1594323, 3188646, 4782969, 9565938, 14348907, 28697814, 43046721, 86093442, 129140163, 258280326, 387420489
Offset: 0

Views

Author

Henry Bottomley, May 03 2000

Keywords

Comments

In general, for the recurrence a(n) = a(n-1)*a(n-2)/a(n-3), all terms are integers iff a(0) divides a(2) and first three terms are positive integers, since a(2n+k) = a(k)*(a(2)/a(0))^n for all nonnegative integers n and k.
Equals eigensequence of triangle A070909; (1, 1, 2, 3, 6, 9, 18, ...) shifts to the left with multiplication by triangle A070909. - Gary W. Adamson, May 15 2010
The a(n) represent all paths of length (n+1), n >= 0, starting at the initial node on the path graph P_5, see the second Maple program. - Johannes W. Meijer, May 29 2010
a(n) is the difference between numbers of multiple of 3 evil (A001969) and odious (A000069) numbers in interval [0, 2^(n+1)). - Vladimir Shevelev, May 16 2012
A "half-geometric progression": to obtain a term (beginning with the third one) we multiply the before previous one by 3. - Vladimir Shevelev, May 21 2012
Pisano periods: 1, 2, 1, 4, 8, 2, 12, 4, 1, 8, 10, 4, 6, 12, 8, 8, 32, 2, 36, 8, ... . - R. J. Mathar, Aug 10 2012
Numbers k such that the k-th cyclotomic polynomial has a root mod 3. - Eric M. Schmidt, Jul 31 2013
Range of row n of the circular Pascal array of order 6. - Shaun V. Ault, Jun 05 2014
Also, the number of walks of length n on the graph 0--1--2--3--4 starting at vertex 1. - Sean A. Irvine, Jun 03 2025

Examples

			In the interval [0,2^5) we have 11 multiples of 3 numbers, from which 10 are evil and only one (21) is odious. Thus a(4) = 10 - 1 = 9. - _Vladimir Shevelev_, May 16 2012
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a038754 n = a038754_list !! n
    a038754_list = concat $ transpose [a000244_list, a008776_list]
    -- Reinhard Zumkeller, Oct 19 2015
    
  • Magma
    [n le 2 select n else 3*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Aug 18 2016
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=3*a[n-2]+2 od: seq(a[n]+1, n=0..34); # Zerinvary Lajos, Mar 20 2008
    with(GraphTheory): P:=5: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=35; for n from 1 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P) od: seq(a(n),n=1..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    LinearRecurrence[{0,3},{1,2},40] (* Harvey P. Dale, Jan 26 2014 *)
    CoefficientList[Series[(1+2x)/(1-3x^2), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 18 2016 *)
    Module[{nn=20,c},c=3^Range[0,nn];Riffle[c,2c]] (* Harvey P. Dale, Aug 21 2021 *)
  • PARI
    a(n)=(1/6)*(5-(-1)^n)*3^floor(n/2)
    
  • PARI
    a(n)=3^(n>>1)<
    				
  • SageMath
    [2^(n%2)*3^((n-(n%2))/2) for n in range(61)] # G. C. Greubel, Oct 10 2022

Formula

a(n) = a(n-1)*a(n-2)/a(n-3) with a(0)=1, a(1)=2, a(2)=3.
a(2*n) = (3/2)*a(2*n-1) = 3^n, a(2*n+1) = 2*a(2*n) = 2*3^n.
From Benoit Cloitre, Apr 27 2003: (Start)
a(1)=1, a(n)= 2*a(n-1) if a(n-1) is odd, or a(n)= (3/2)*a(n-1) if a(n-1) is even.
a(n) = (1/6)*(5-(-1)^n)*3^floor(n/2).
a(2*n) = a(2*n-1) + a(2*n-2) + a(2*n-3).
a(2*n+1) = a(2*n) + a(2*n-1). (End)
G.f.: (1+2*x)/(1-3*x^2). - Paul Barry, Aug 25 2003
From Reinhard Zumkeller, Sep 11 2003: (Start)
a(n) = (1 + n mod 2) * 3^floor(n/2).
a(n) = A087503(n) - A087503(n-1). (End)
a(n) = sqrt(3)*(2+sqrt(3))*(sqrt(3))^n/6 - sqrt(3)*(2-sqrt(3))*(-sqrt(3))^n/6. - Paul Barry, Sep 16 2003
From Reinhard Zumkeller, May 26 2008: (Start)
a(n) = A140740(n+2,2).
a(n+1) = a(n) + a(n - n mod 2). (End)
If p(i) = Fibonacci(i-3) and if A is the 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-1) = (-1)^n det A. - Milan Janjic, May 08 2010
a(n) = A182751(n) for n >= 2. - Jaroslav Krizek, Nov 27 2010
a(n) = Sum_{i=0..2^(n+1), i==0 (mod 3)} (-1)^A000120(i). - Vladimir Shevelev, May 16 2012
a(0)=1, a(1)=2, for n>=3, a(n)=3*a(n-2). - Vladimir Shevelev, May 21 2012
Sum_(n>=0) 1/a(n) = 9/4. - Alexander R. Povolotsky, Aug 24 2012
a(n) = sqrt(3*a(n-1)^2 + (-3)^(n-1)). - Richard R. Forberg, Sep 04 2013
a(n) = 2^((1-(-1)^n)/2)*3^((2*n-1+(-1)^n)/4). - Luce ETIENNE, Aug 11 2014
From Reinhard Zumkeller, Oct 19 2015: (Start)
a(2*n) = A000244(n), a(2*n+1) = A008776(n).
For n > 0: a(n+1) = a(n) + if a(n) odd then min{a(n), a(n-1)} else max{a(n), a(n-1)}, see also A128588. (End)
E.g.f.: (7*cosh(sqrt(3)*x) + 4*sqrt(3)*sinh(sqrt(3)*x) - 4)/3. - Stefano Spezia, Feb 17 2022
Sum_{n>=0} (-1)^n/a(n) = 3/4. - Amiram Eldar, Dec 02 2022

A084221 a(n+2) = 4*a(n), with a(0)=1, a(1)=3.

Original entry on oeis.org

1, 3, 4, 12, 16, 48, 64, 192, 256, 768, 1024, 3072, 4096, 12288, 16384, 49152, 65536, 196608, 262144, 786432, 1048576, 3145728, 4194304, 12582912, 16777216, 50331648, 67108864, 201326592, 268435456, 805306368, 1073741824, 3221225472, 4294967296, 12884901888
Offset: 0

Views

Author

Paul Barry, May 21 2003

Keywords

Comments

Binomial transform is A060925. Binomial transform of A084222.
Sequences with similar recurrence rules: A016116 (multiplier 2), A038754 (multiplier 3), A133632 (multiplier 5). See A133632 for general formulas. - Hieronymus Fischer, Sep 19 2007
Equals A133080 * A000079. A122756 is a companion sequence. - Gary W. Adamson, Sep 19 2007

Examples

			Binary...............Decimal
1..........................1
11.........................3
100........................4
1100......................12
10000.....................16
110000....................48
1000000...................64
11000000.................192
100000000................256
1100000000...............768
10000000000.............1024
110000000000............3072, etc. - _Philippe Deléham_, Mar 21 2014
		

Crossrefs

For partial sums see A133628. Partial sums for other multipliers p: A027383(p=2), A087503(p=3), A133629(p=5).
Other related sequences: A132666, A132667, A132668, A132669.

Programs

Formula

a(n) = (5*2^n-(-2)^n)/4.
G.f.: (1+3*x)/((1-2*x)(1+2*x)).
E.g.f.: (5*exp(2*x) - exp(-2*x))/4.
a(n) = A133628(n) - A133628(n-1) for n>1. - Hieronymus Fischer, Sep 19 2007
Equals A133080 * [1, 2, 4, 8, ...]. Row sums of triangle A133087. - Gary W. Adamson, Sep 08 2007
a(n+1)-2a(n) = A000079 signed. a(n)+a(n+2)=5*a(n). First differences give A135520. - Paul Curtz, Apr 22 2008
a(n) = A074323(n+1)*A016116(n). - R. J. Mathar, Jul 08 2009
a(n+3) = a(n+2)*a(n+1)/a(n). - Reinhard Zumkeller, Mar 04 2011
a(n) = Sum_{k=0..n+1} A181650(n+1,k)*2^k. - Philippe Deléham, Nov 19 2011
a(2*n) = A000302(n); a(2*n+1) = A164346(n). - Philippe Deléham, Mar 21 2014

Extensions

Edited by N. J. A. Sloane, Dec 14 2007

A246360 a(1) = 1, then A007051 ((3^n)+1)/2 interleaved with A057198 (5*3^(n-1)+1)/2.

Original entry on oeis.org

1, 2, 3, 5, 8, 14, 23, 41, 68, 122, 203, 365, 608, 1094, 1823, 3281, 5468, 9842, 16403, 29525, 49208, 88574, 147623, 265721, 442868, 797162, 1328603, 2391485, 3985808, 7174454, 11957423, 21523361, 35872268, 64570082, 107616803, 193710245, 322850408, 581130734
Offset: 1

Views

Author

Antti Karttunen, Aug 24 2014

Keywords

Comments

Also record values in A048673.

Crossrefs

Even bisection: A007051 from A007051(1) onward: [2, 5, 14, 41, ...]
Odd bisection: 1 followed by A057198.
A029744 gives the corresponding record positions in A048673.
A247284 gives the maximum values of A048673 between these records and A247283 gives the positions where they occur.
Subsequence of A246361.

Programs

  • Mathematica
    LinearRecurrence[{1, 3, -3}, {1, 2, 3, 5}, 40] (* Hugo Pfoertner, Sep 27 2022 *)
  • Python
    def A246360(n): return 1 if n==1 else (3+((n&1)<<1))*3**((n>>1)-1)+1>>1 # Chai Wah Wu, Sep 02 2025
  • Scheme
    (define (A246360 n) (cond ((<= n 1) n) ((even? n) (/ (+ 1 (A000244 (/ n 2))) 2)) (else (/ (+ 1 (* 5 (A000244 (/ (- n 3) 2)))) 2))))
    

Formula

a(1) = 1, a(2n) = (3^n+1)/2, a(2n+1) = (5 * 3^(n-1)+1)/2.
a(n) = A048673(A029744(n)).
a(n) = A087503(n-3) + 2 for n >= 3. - Peter Kagey, Nov 30 2019
G.f.: x -x^2*(-2-x+4*x^2) / ( (x-1)*(3*x^2-1) ). - R. J. Mathar, Sep 23 2014

A133628 a(1)=1, a(n) = a(n-1) + (p-1)*p^(n/2-1) if n is even, else a(n) = a(n-1) + p^((n-1)/2), where p=4.

Original entry on oeis.org

1, 4, 8, 20, 36, 84, 148, 340, 596, 1364, 2388, 5460, 9556, 21844, 38228, 87380, 152916, 349524, 611668, 1398100, 2446676, 5592404, 9786708, 22369620, 39146836, 89478484, 156587348, 357913940, 626349396, 1431655764, 2505397588
Offset: 1

Views

Author

Hieronymus Fischer, Sep 19 2007

Keywords

Comments

This is essentially a duplicate of A097164. - R. J. Mathar, Jun 08 2008
Partial sums of A084221.

Crossrefs

Sequences with similar recurrence rules: A027383(p=2), A087503(p=3), A133629(p=5).
See A133629 for general formulas with respect to the recurrence rule parameter p.
Related sequences: A132666, A132667, A132668, A132669.
Other related sequences for different p: A016116(p=2), A038754(p=3), A084221(p=4), A133632(p=5).

Programs

  • Magma
    [4^Floor(n/2)+4^Floor((n+1)/2)/3-4/3: n in [1..40]]; // Vincenzo Librandi, Aug 17 2011
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=4*a[n-2]+4 od: seq(a[n], n=1..31); # Zerinvary Lajos, Mar 17 2008
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[OddQ[n],a+3*4^((n+1)/2-1),a+4^(n/2)]}; Transpose[ NestList[ nxt,{1,1},30]][[2]] (* Harvey P. Dale, Mar 31 2013 *)
  • PARI
    vector(40, n, (3*4^floor(n/2) + 4^floor((n+1)/2) - 4)/3) \\ G. C. Greubel, Nov 08 2018

Formula

a(n) = Sum_{k=1..n} A084221(k).
G.f.: x*(1+3*x)/((1-4*x^2)*(1-x)).
a(n) = (4/3)*(4^(n/2)-1) if n is even, otherwise a(n) = (4/3)*(7*4^((n-3)/2)-1).
a(n) = (4/3)*(4^floor(n/2) + 4^floor((n-1)/2) - 4^floor((n-2)/2) - 1).
a(n) = 4^floor(n/2) + 4^floor((n+1)/2)/3 - 4/3.
a(n) = A132668(a(n+1)) - 1.
a(n) = A132668(a(n-1) + 1) for n > 0.
A132668(a(n)) = a(n-1) + 1 for n > 0.

A133632 a(1)=1, a(n) = (p-1)*a(n-1), if n is even, otherwise a(n) = p*a(n-2), where p = 5.

Original entry on oeis.org

1, 4, 5, 20, 25, 100, 125, 500, 625, 2500, 3125, 12500, 15625, 62500, 78125, 312500, 390625, 1562500, 1953125, 7812500, 9765625, 39062500, 48828125, 195312500, 244140625, 976562500, 1220703125, 4882812500, 6103515625, 24414062500
Offset: 1

Views

Author

Hieronymus Fischer, Sep 19 2007

Keywords

Comments

Binomial transform = A134418: (1, 5, 14, 48, 152, 496, 1600, ...). Double binomial transform = A048875: (1, 6, 25, 106, 449, 1902, ...) - Gary W. Adamson, Oct 24 2007

Crossrefs

For the partial sums see A133629.
Sequences with similar recurrence rules: A016116(p=2), A038754(p=3), A084221(p=4).
Partial sums for other p: A027383(p=2), A087503(p=3), A133628(p=4).
Other related sequences: A132666, A132667, A132668, A132669.

Programs

  • Mathematica
    RecurrenceTable[{a[1]==1,a[2]==4,a[n]==If[EvenQ[n],4a[n-1],5a[n-2]]},a,{n,30}] (* Harvey P. Dale, Jan 14 2013 *)

Formula

The following formulas are given for a general natural parameter p > 1 (p = 5 for this sequence).
G.f.: g(x) = x(1+(p-1)x)/(1-px^2).
a(n) = p^floor((n-1)/2)*(p+(p-2)*(-1)^n)/2.
a(n) = A133629(n) - A133629(n-1) for n > 1.
a(n+3) = a(n+2)*a(n+1)/a(n). - Reinhard Zumkeller, Mar 04 2011

A132667 a(1)=1, a(n) = 3*a(n-1) if the minimal positive integer not yet in the sequence is greater than a(n-1), else a(n) = a(n-1) - 1.

Original entry on oeis.org

1, 3, 2, 6, 5, 4, 12, 11, 10, 9, 8, 7, 21, 20, 19, 18, 17, 16, 15, 14, 13, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 120, 119, 118, 117, 116
Offset: 1

Views

Author

Hieronymus Fischer, Aug 24 2007, Sep 15 2007, Sep 23 2007

Keywords

Comments

Also: a(1)=1, a(n) = maximal positive integer < a(n-1) not yet in the sequence, if it exists, else a(n) = 3*a(n-1).
Also: a(1)=1, a(n) = a(n-1) - 1, if a(n-1) - 1 > 0 and has not been encountered so far, else a(n) = 3*a(n-1).
A permutation of the positive integers. The sequence is self-inverse, in that a(a(n)) = n.

Crossrefs

For formulas concerning a general parameter p (with respect to the recurrence rule ... a(n)=p*a(n-1) ...) see A132374. For p=2 to p=10 see A132666 through A132674.
Cf. A087503.

Formula

G.f.: g(x) = (x(1-2x)/(1-x) + 3x^2*f'(x^(5/2)) + (5/9)*(f'(x^(1/2)) - 3x - 1))/(1-x) where f(x) = Sum_{k>=0} x^(3^k) and f'(z) = derivative of f(x) at x = z.
a(n) = 4*3^(r/2) - 2 - n if both r and s are even, else a(n) = 7*3^((s-1)/2) - 2 - n, where r = ceiling(2*log_3((2*n+3)/5)), s = ceiling(2*log_3((2*n+3)/3) - 1).
a(n) = (3^floor(1 + (k+1)/2) + 5*3^floor(k/2) - 4)/2 - n, where k=r if r is odd, else k=s (with respect to r and s above; formally, k = ((r+s) - (r-s)*(-1)^r)/2).
a(n) = A087503(m) + A087503(m+1) + 1 - n, where m:=max{ k | A087503(k)
a(A087503(n) + 1) = A087503(n+1).
a(A087503(n)) = A087503(n-1) + 1 for n > 0.

A133629 a(1)=1, a(n) = a(n-1) + (p-1)*p^(n/2-1) if n is even, otherwise a(n) = a(n-1) + p^((n-1)/2), where p=5.

Original entry on oeis.org

1, 5, 10, 30, 55, 155, 280, 780, 1405, 3905, 7030, 19530, 35155, 97655, 175780, 488280, 878905, 2441405, 4394530, 12207030, 21972655, 61035155, 109863280, 305175780, 549316405, 1525878905, 2746582030, 7629394530, 13732910155, 38146972655, 68664550780
Offset: 1

Author

Hieronymus Fischer, Sep 19 2007

Keywords

Comments

Partial sums of A133632.

Crossrefs

Sequences with similar recurrence rules: A027383 (p=2), A087503 (p=3), A133628 (p=4).
Related sequences: A132666, A132667, A132668, A132669.
Other related sequences for different p: A016116 (p=2), A038754 (p=3), A084221 (p=4), A133632 (p=5).

Programs

  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=5*a[n-2]+5 od: seq(a[n], n=1..29); # Zerinvary Lajos, Mar 17 2008
  • PARI
    Vec(x*(1 + 4*x) / ((1 - x) * (1 - 5*x^2)) + O(x^40)) \\ Colin Barker, Nov 25 2016
    
  • Python
    def A133629(n): return (5+((n&1)<<2))*5**(n>>1)-5>>2 # Chai Wah Wu, Sep 02 2025

Formula

a(n) = Sum_{k=1..n} A133632(k).
The following formulas are given for a general natural parameter p > 1 (p=5 for this sequence).
G.f.: x(1+(p-1)x)/((1-px^2)(1-x)).
a(n) = (p/(p-1))*(p^(n/2)-1) if n is even, otherwise a(n)=(p/(p-1))*((2p-1)*p^((n-3)/2)-1).
a(n) = (p/(p-1))*(p^floor(n/2) + p^floor((n-1)/2) - p^floor((n-2)/2)-1).
a(n) = p^floor(n/2) + (p^floor((n+1)/2)-p)/(p-1).
a(n) = A132669(a(n+1)) - 1.
a(n) = A132669(a(n-1)+1) for n > 0.
A132669(a(n)) = a(n-1)+1 for n > 0.
From Colin Barker, Nov 25 2016: (Start)
a(n) = 5*(5^(n/2) - 1)/4 for n even.
a(n) = (9*5^(n/2-1/2) - 5)/4 for n odd.
a(n) = a(n-1) + 5*a(n-2) - 5*a(n-3) for n > 3.
G.f.: x*(1 + 4*x) / ((1 - x) * (1 - 5*x^2)).
(End)

A132669 a(1)=1, a(n) = 5*a(n-1) if the minimal positive integer not yet in the sequence is greater than a(n-1), else a(n) = a(n-1) - 1.

Original entry on oeis.org

1, 5, 4, 3, 2, 10, 9, 8, 7, 6, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143
Offset: 1

Author

Hieronymus Fischer, Sep 15 2007, Sep 23 2007

Keywords

Comments

Also: a(1)=1, a(n) = maximal positive integer < a(n-1) not yet in the sequence, if it exists, else a(n) = 5*a(n-1).
Also: a(1)=1, a(n) = a(n-1) - 1, if a(n-1) - 1 > 0 and has not been encountered so far, else a(n) = 5*a(n-1).
A permutation of the positive integers. The sequence is self-inverse, in that a(a(n)) = n.

Crossrefs

For formulas concerning a general parameter p (with respect to the recurrence rule ... a(n) = p*a(n-1) ...) see A132374.
For p=2 to p=10 see A132666 through A132674.
Cf. A087503.

Formula

G.f.: g(x) = (x(1-2x)/(1-x) + 5x^2*f'(x^(9/4)) + (9/25)*(f'(x^(1/4)) - 5x - 1))/(1-x) where f(x) = Sum_{k>=0} x^(5^k) and f'(z) = derivative of f(x) at x = z.
a(n) = (14*5^(r/2) - 6)/4 - n, if both r and s are even, else a(n) = (34*5^((s-1)/2) - 6)/4 - n, where r = ceiling(2*log_5((4n+5)/9)) and s = ceiling(2*log_5((4n+5)/5)) - 1.
a(n) = (5^floor(1 + (k+1)/2) + 9*5^floor(k/2) - 6)/4 - n, where k=r, if r is odd, else k=s (with respect to r and s above; formally, k = ((r+s) - (r-s)*(-1)^r)/2).
a(n) = A133629(m) + A133629(m+1) + 1 - n, where m:=max{ k | A133629(k) < n }.
a(A133629(n) + 1) = A133629(n+1).
a(A133629(n)) = A133629(n-1) + 1 for n > 0.

A329233 The time of the first counterclockwise step during the grasshopper procedure, or 0 if no counterclockwise steps occur.

Original entry on oeis.org

0, 0, 2, 0, 4, 5, 4, 0, 4, 4, 6, 5, 8, 5, 5, 0, 13, 6, 10, 6, 6, 7, 12, 17, 7, 8, 7, 7, 16, 8, 16, 0, 8, 12, 8, 8, 20, 13, 9, 10, 25, 9, 22, 9, 9, 13, 24, 17, 10, 12, 11, 10, 28, 10, 10, 11, 12, 16, 30, 11, 32, 17, 11, 0, 11, 11, 34, 12, 14, 13, 36, 12, 41
Offset: 1

Author

Peter Kagey, Nov 10 2019

Keywords

Comments

The grasshopper procedure: n positions are evenly spaced around a circle, a grasshopper hops randomly to any position, after the k-th hop, the grasshopper looks clockwise and counterclockwise k positions. If one of the positions has been visited less often then the other, it hops there; if both positions have been visited an equal number of times, it hops k steps in the clockwise position. (See Mathematics Stack Exchange link for more details.)
Either a(n) = 0 or a(n) >= A003056(n).
Conjecture: a(3^n) = A087503(n-1) + 1 for n > 0. (Checked up to 3^12.) - Peter Kagey, Nov 28 2019

Crossrefs

A357302 Numbers k such that k^2 can be represented as x^2 + x*y + y^2 in more ways than for any smaller k.

Original entry on oeis.org

1, 7, 49, 91, 637, 1729, 12103, 53599, 375193, 1983163, 13882141, 85276009, 596932063, 4178524441, 5201836549, 36412855843, 254889990901, 348523048783, 2439661341481, 17077629390367, 25442182561159, 178095277928113, 1246666945496791, 2009932422331561, 14069526956320927
Offset: 1

Author

Hugo Pfoertner, Sep 25 2022

Keywords

Comments

Apparently the number of grid points t(n) = {1, 2, 3, 5, 8, 14, 23, ...} (A357303) in the reduced representations as described in the examples matches t(n) = A087503(n-3) + 2 for n >= 3, i.e., t(n) = t(n-1) + 3*t(n-2) - 3*t(n-3) for n >= 5. This coincidence persists up to t(15) = 1823, but t(16) = 2553, whereas the recurrence predicts 3281, which is t(17). It seems that all of the terms generated by the recurrence also appear as record numbers of grid points. However, there are other record numbers in between, of which 2553 is the first occurrence.

Examples

			The essential information in the complete set of representations of a square a(n)^2 can be extracted by taking into account the symmetries of the triangular lattice. If r is the number of all representations of a(n)^2, then there are t = (r/6 + 1)/2 pairs of triangular oblique coordinates lying in a sector of angular width Pi/6 completely containing the essential information.
a(1) = 1: r = 6 representations of 1^2 are [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0] reduced: (6/6 + 1)/2 = 1 grid point [1,0].
a(2) = 7: r = 18 representations of 7^2 = 49 are [-8, 5], [-7, 0], [-7, 7], [-5, -3], [-5, 8], [-3, -5], [-3, 8], [0, -7], [0, 7], [3, -8], [3, 5], [5, -8], [5, 3], [7, -7], [7, 0], [8, -5], [8, -3], [8, 3]; reduced: (18/6 + 1)/2 = 2 grid points [7, 0], [8, 3].
After a(2) = 7 there are no squares with more than 18 representations, e.g., r = 18 for 13^2, 14^2, 19^2, 21^2, ..., 42^2, 43^2.
a(3) = 49: r = 30 representations of 49^2 = 2401 are [-56, 21], [-56, 35], [-55, 16], [-55, 39], [-49, 0], [-49, 49], [-39, -16], [-39, 55], [-35, -21], [-35, 56], [-21, -35], [-21, 56], [-16, -39], [-16, 55], [0, -49], [0, 49], [16, -55], [16, 39], [21, -56], [21, 35], [35, -56], [35, 21], [39, -55], [39, 16], [49, -49], [49, 0], [55, -39], [55, -16], [56, -35], [56, -21]; reduced: (30/6 + 1)/2 = 3 grid points [49, 0], [55, 16], [56, 21].
There are no squares with r > 18 between 49 and 90.
a(4) = 91: r = 54 representations of 91^2 = 8281 are [-105,49], [-105,56], ..., [105, -56], [105,-49]; reduced: (54/6 + 1)/2 = 5 grid points [91, 0], [96, 11], [99, 19], [104, 39], [105, 49].
		

Programs

  • PARI
    a357302(upto) = {my (dmax=0);for (k = 1, upto, my (d = #qfbsolve (Qfb(1,1,1), k^2, 3)); if(d > dmax, print1(k,", "); dmax=d))};
    a357302(400000)
    
  • PARI
    \\ more efficient using function list_A344473 (see there)
    a355703(maxexp10)= {my (sqterms=select(x->issquare(x), list_A344473 (10^(2*maxexp10))), r=0); for (k=1, #sqterms, my (d = #qfbsolve(Qfb(1,1,1),v[k],3)); if (d>r, print1(sqrtint(v[k]),", "); r=d))};
    a355703(17)
    
  • Python
    from itertools import count, islice
    from sympy.abc import x,y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A357302_gen(): # generator of terms
        c = 0
        for k in count(1):
            if (d:=len(diop_quadratic(x*(x+y)+y**2-k**2))) > c:
                yield k
                c = d
    A357302_list = print(list(islice(A357302_gen(),6))) # Chai Wah Wu, Sep 26 2022
Showing 1-10 of 12 results. Next