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-7 of 7 results.

A177704 Period 4: repeat [1, 1, 1, 2].

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, May 11 2010

Keywords

Comments

Continued fraction expansion of (3 + 2*sqrt(6))/5.
Decimal expansion of 1112/9999.
a(n) = A164115(n + 1) = (-1)^(n + 1) * A164117(n + 1) = A138191(n + 3) = A107453(n + 5).

Crossrefs

Programs

  • Magma
    &cat[ [1, 1, 1, 2]: k in [1..27] ];
    
  • Maple
    A177704:=n->floor((n+1)*5/4) - floor(n*5/4): seq(A177704(n), n=0..100); # Wesley Ivan Hurt, Jun 15 2016
  • Mathematica
    Table[Floor[(n + 1)*5/4] - Floor[n*5/4], {n, 0, 100}] (* Wesley Ivan Hurt, Jun 15 2016 *)
    LinearRecurrence[{0, 0, 0, 1}, {1, 1, 1, 2}, 100] (* Vincenzo Librandi, Jun 16 2016 *)
  • PARI
    a(n) = if(n%4==3, 2, 1) \\ Felix Fröhlich, Jun 15 2016

Formula

a(n) = (5-(-1)^n + i*i^n-i*(-i)^n)/4 where i = sqrt(-1).
a(n) = a(n-4) for n > 3; a(0) = 1, a(1) = 1, a(2) = 1, a(3) = 2.
G.f.: (1+x+x^2+2*x^3)/(1-x^4).
a(n) = 1 + (1-(-1)^n) * (1+i^(n+1))/4 where i = sqrt(-1). - Bruno Berselli, Apr 05 2011
a(n) = 5/4 - sin(Pi*n/2)/2 - (-1)^n/4. - R. J. Mathar, Oct 08 2011
a(n) = floor((n+1)*5/4) - floor(n*5/4). - Hailey R. Olafson, Jul 23 2014
From Wesley Ivan Hurt, Jun 15 2016: (Start)
a(n+3) - a(n+2) = A219977(n).
Sum_{i=0..n-1} a(i) = A001068(n). (End)
E.g.f.: (-sin(x) + 3*sinh(x) + 2*cosh(x))/2. - Ilya Gutkovskiy, Jun 15 2016

A385195 The number of integers k from 1 to n such that the greatest divisor of k that is a unitary divisor of n is either 1 or 2.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 6, 7, 8, 8, 10, 6, 12, 12, 8, 15, 16, 16, 18, 12, 12, 20, 22, 14, 24, 24, 26, 18, 28, 16, 30, 31, 20, 32, 24, 24, 36, 36, 24, 28, 40, 24, 42, 30, 32, 44, 46, 30, 48, 48, 32, 36, 52, 52, 40, 42, 36, 56, 58, 24, 60, 60, 48, 63, 48, 40, 66, 48, 44
Offset: 1

Views

Author

Amiram Eldar, Jun 21 2025

Keywords

Examples

			For n = 6, the greatest divisor of k that is a unitary divisor of 6 for k = 1 to 6 is 1, 2, 3, 2, 1 and 6, respectively. 4 of the values are either 1 or 2, and therefore a(6) = 4.
		

Crossrefs

The unitary analog of A126246 (with respect to the definition "the number of integers k from 1 to n such that gcd(n,k) is either 1 or 2").
The number of integers k from 1 to n such that the greatest divisor of k that is a unitary divisor of n is: A047994 (1), A384048 (squarefree), A384049 (cubefree), A384050 (powerful), A384051 (cubefull), A384052 (square), A384053 (cube), A384054 (exponentially odd), A384055 (odd), A384056 (power of 2), A384057 (3-smooth), A384058 (5-rough), this sequence (1 or 2), A385196 (prime), A385197 (noncomposite), A385198 (prime power), A385199 (1 or prime power).

Programs

  • Mathematica
    f[p_, e_] := p^e - 1; f[2, 1] = 2; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~,f[i,1]^f[i,2] - if(f[i,1] == 2 && f[i,2] == 1, 0, 1));}

Formula

Multiplicative with a(p^e) = 2 if p = 2 and e = 1, and p^e - 1 otherwise.
In general, the number of integers k from 1 to n such that ugcd(n, k), the greatest divisor of k that is a unitary divisor of n, is either 1 or a prime power q is a multiplicative function f(n) with f(p^e) = q if p^e = q, and p^e - 1 otherwise.
a(n) = A138191(n) * A047994(n), i.e., a(n) = 2*A047994(n) if n == 2 (mod 4) and A047994(n) otherwise.
In general, the number of integers k from 1 to n such that ugcd(n, k) is either 1 or a prime power q is (q/(q-1))*A047994(n) if q is a unitary divisor of n, and A047994(n) otherwise.
Sum_{k=1..n} a(k) ~ (23/40) * c * n^2, where c = Product_{p prime} (1 - 1/(p*(p+1))) = A065463.
In general, the average order of the number of integers k from 1 to n such that ugcd(n, k) is either 1 or a prime p is ((p^4+p^3-1)/(p^4+p^3-p^2)) * c * n^2 / 2, where c = A065463.

A138190 Numerator of (n-1)*n*(n+1)/12.

Original entry on oeis.org

0, 1, 2, 5, 10, 35, 28, 42, 60, 165, 110, 143, 182, 455, 280, 340, 408, 969, 570, 665, 770, 1771, 1012, 1150, 1300, 2925, 1638, 1827, 2030, 4495, 2480, 2728, 2992, 6545, 3570, 3885, 4218, 9139, 4940, 5330, 5740, 12341, 6622, 7095, 7590, 16215, 8648
Offset: 1

Views

Author

Eric W. Weisstein, Mar 04 2008

Keywords

Examples

			0, 1/2, 2, 5, 10, 35/2, 28, 42, 60, 165/2, 110, 143, 182, ...
		

Crossrefs

Programs

  • Mathematica
    Table[(n^3-n)/12,{n,50}]//Numerator (* or *) LinearRecurrence[{0,0,0,4,0,0,0,-6,0,0,0,4,0,0,0,-1},{0,1,2,5,10,35,28,42,60,165,110,143,182,455,280,340},50] (* Harvey P. Dale, Nov 05 2021 *)
  • PARI
    a(n) = numerator((n-1)*n*(n+1)/12); \\ Michel Marcus, Feb 17 2015
    
  • PARI
    a(n)=binomial(n+1,3)/if(n%4==2,1,2) \\ Charles R Greathouse IV, Feb 17 2015

Formula

a(n+2) = numerator of A000295(n+2)/(3*Integral_{t=0..2} t^n*(1-abs(1-t))^2).
a(n) = (n*(n-1)*(n+1)*(5+((-1)^n-(-1)^((2*n-1+(-1)^n)/4)-(-1)^((6*n-1+(-1)^n)/4))))/48. - Luce ETIENNE, Feb 17 2015
G.f.: x^2*(x^12 +2*x^11 +5*x^10 +10*x^9 +31*x^8 +20*x^7 +22*x^6 +20*x^5 +31*x^4 +10*x^3 +5*x^2 +2*x +1) / ((x -1)^4*(x +1)^4*(x^2 +1)^4). - Colin Barker, Feb 17 2015
Sum_{n>=2} 1/a(n) = 3 * (1 - log(2)/2). - Amiram Eldar, Aug 11 2022

A164115 Expansion of (1 - x^5) / ((1 - x) * (1 - x^4)) in powers of x.

Original entry on oeis.org

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

Views

Author

Michael Somos, Aug 10 2009

Keywords

Comments

The sequence A107453 has the same terms but different offset.
Convolution inverse of A164116.
Decimal expansion of 11111/99990. - Elmo R. Oliveira, Feb 18 2024

Examples

			1 + x + x^2 + x^3 + 2*x^4 + x^5 + x^6 + x^7 + 2*x^8 + x^9 + x^10 + ...
		

Crossrefs

Programs

  • Magma
    m:=100; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+x+x^2+x^3+x^4)/(1-x^4))); // G. C. Greubel, Sep 22 2018
  • Mathematica
    CoefficientList[Series[(1+x+x^2+x^3+x^4)/(1-x^4), {x, 0, 100}], x] (* G. C. Greubel, Sep 22 2018 *)
    LinearRecurrence[{0,0,0,1},{1,1,1,1,2},120] (* or *) PadRight[{1},120,{2,1,1,1}] (* Harvey P. Dale, Aug 24 2019 *)
  • PARI
    {a(n) = 2 - (n==0) - (n%4>0)}
    
  • PARI
    x='x+O('x^99); Vec((1-x^5)/((1-x)*(1-x^4))) \\ Altug Alkan, Sep 23 2018
    

Formula

Euler transform of length-5 sequence [ 1, 0, 0, 1, -1].
a(n) is multiplicative with a(2) = 1, a(2^e) = 2 if e>1, a(p^e) = 1 if p>2.
a(n) = (-1)^n * A164117(n).
a(4*n) = 2 unless n=0. a(2*n + 1) = a(4*n + 2) = 1.
a(-n) = a(n). a(n+4) = a(n) unless n=0 or n=-4.
G.f.: (1 + x + x^2 + x^3 + x^4) / ((1+x)*(1-x)*(1+x^2)).
a(n) = A138191(n+2), n>0. - R. J. Mathar, Aug 17 2009
Dirichlet g.f. (1+1/4^s)*zeta(s). - R. J. Mathar, Feb 24 2011
a(n) = (i^n + (-i)^n + (-1)^n + 5)/4 for n > 0 where i is the imaginary unit. - Bruno Berselli, Feb 25 2011

A236398 Period 4: repeat 1,1,2,1.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jan 29 2014

Keywords

References

  • H. Blaine Lawson, Jr. and M.-L. Michelsohn, Spin Geometry, Princeton, p. 33.

Crossrefs

Programs

Formula

a(n) = a(n-4) for n > 4. G.f.: x*(1 + x + 2*x^2 + x^3)/(1 - x^4). - Chai Wah Wu, Jun 04 2016
E.g.f.: (-2 - sin(x) + 3*sinh(x) + 2*cosh(x))/2. - Ilya Gutkovskiy, Jun 04 2016
a(n) = (5-cos(n*Pi)-2*sin(n*Pi/2))/4. - Luce ETIENNE, Feb 17 2017

Extensions

Definition corrected by Paul Curtz. - N. J. A. Sloane, Oct 10 2016

A246943 a(4n) = 4*n , a(2n+1) = 8*n+4 , a(4n+2) = 2*n+1.

Original entry on oeis.org

0, 4, 1, 12, 4, 20, 3, 28, 8, 36, 5, 44, 12, 52, 7, 60, 16, 68, 9, 76, 20, 84, 11, 92, 24, 100, 13, 108, 28, 116, 15, 124, 32, 132, 17, 140, 36, 148, 19, 156, 40, 164, 21, 172, 44, 180, 23, 188, 48, 196, 25, 204, 52, 212, 27, 220, 56, 228
Offset: 0

Views

Author

Paul Curtz, Sep 08 2014

Keywords

Comments

Consider the denominators of the Balmer series A061038(n) = 0, 4, 1, 36, 16, 100,... (a permutation of the squares of the nonnegative numbers i.e. A000290(n)) divided by A028310(n)=1,1,2,... . The numerators are a(n). The denominators are A138191(n).
Note that A061038(3n)=9*A061038(n), n>=1.
a(3n) is divisible by the period 3 sequence: repeat 9, 3, 3.

Examples

			Numerators of a(0)=0/1=0, a(1)=4/1=4, a(2)=1/2, a(3)=36/3=12,... .
		

Crossrefs

Programs

  • Maple
    A246943:=n->n*(19-(-1)^n*13+2*cos(n*Pi/2))/8: seq(A246943(n), n=0..100); # Wesley Ivan Hurt, Apr 18 2017
  • Mathematica
    LinearRecurrence[{0,0,0,2,0,0,0,-1},{0,4,1,12,4,20,3,28},60] (* Harvey P. Dale, Jun 22 2022 *)
  • PARI
    concat(0, Vec(x*(4*x^6+x^5+12*x^4+4*x^3+12*x^2+x+4)/((x-1)^2*(x+1)^2*(x^2+1)^2) + O(x^100))) \\ Colin Barker, Sep 08 2014

Formula

Numerators of A061038(n)/A028310(n).
a(2n) = A022998(n).
G.f.: x*(4*x^6+x^5+12*x^4+4*x^3+12*x^2+x+4) / ((x-1)^2*(x+1)^2*(x^2+1)^2). - Colin Barker, Sep 08 2014
a(n) = n*(19-13*(-1)^n+(1+(-1)^n)*(-1)^((2*n-1+(-1)^n)/4))/8. - Luce ETIENNE, May 26 2015
a(n) = n*(19-(-1)^n*13+2*cos(n*Pi/2))/8. - Giovanni Resta, May 26 2015

A371124 a(n) is the least nonnegative integer y such that y^2 = x^2 - k*n for k and x where n > k >= 1 and n > x >= floor(sqrt(n)).

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 3, 1, 0, 4, 5, 2, 6, 6, 1, 0, 8, 0, 9, 4, 2, 10, 11, 1, 0, 12, 3, 6, 14, 2, 15, 2, 4, 16, 1, 0, 18, 18, 5, 3, 20, 4, 21, 10, 2, 22, 23, 1, 0, 0, 7, 12, 26, 6, 3, 5, 8, 28, 29, 2, 30, 30, 1, 0, 4, 8, 33, 16, 10, 2, 35, 3, 36, 36, 5, 18, 2, 10
Offset: 1

Views

Author

Darío Clavijo, Mar 11 2024

Keywords

Comments

a(A000290(n)) = 0.
a(A077591(n)) = 0.
a(A005563(n)) = 1.
For each n: k = A138191(n) and x = A306284(n).

Examples

			 n  | k | x | y^2 = x^2 - k*n  | y
------------------------------------
 1  | 1 | 1 | 0^2 = 1^2 - 1*1  | 0
 2  | 2 | 2 | 0^2 = 2^2 - 2*1  | 0
 11 | 1 | 6 | 5^2 = 6^2 - 1*11 | 5
		

Crossrefs

Programs

  • Python
    from sympy.core.power import isqrt
    from sympy.ntheory.primetest import is_square
    def a(n):
      x = isqrt(n)
      while True:
        for y2 in range(x**2-n, -1, -n):
          if is_square(y2): return isqrt(y2)
        x+=1
    print([a(n) for n in range(1, 79)])
    
  • Python
    from itertools import count
    def A371124(n):
        y, a = 0, {}
        for x in count(0):
            if y in a: return a[y]
            a[y] = x
            y = (y+(x<<1)+1)%n # Chai Wah Wu, Apr 25 2024

Formula

a(n) = floor(sqrt(A306284(n)^2 - n*A138191(n))).
a(A000040(n)) = A102781(n).
Showing 1-7 of 7 results.