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

A009116 Expansion of e.g.f. cos(x) / exp(x).

Original entry on oeis.org

1, -1, 0, 2, -4, 4, 0, -8, 16, -16, 0, 32, -64, 64, 0, -128, 256, -256, 0, 512, -1024, 1024, 0, -2048, 4096, -4096, 0, 8192, -16384, 16384, 0, -32768, 65536, -65536, 0, 131072, -262144, 262144, 0, -524288, 1048576, -1048576, 0, 2097152, -4194304
Offset: 0

Views

Author

Keywords

Comments

Apart from signs, generated by 1,1 position of H_2^n = [1,1;-1,1]^n; and a(n) = 2^(n/2)*cos(Pi*n/2). - Paul Barry, Feb 18 2004
Equals binomial transform of "Period 4, repeat [1, 0, -1, 0]". - Gary W. Adamson, Mar 25 2009
Pisano period lengths: 1, 1, 8, 1, 4, 8, 24, 1, 24, 4, 40, 8, 12, 24, 8, 1, 16, 24, 72, 4, ... - R. J. Mathar, Aug 10 2012

Examples

			G.f. = 1 - x + 2*x^3 - 4*x^4 + 4*x^5 - 8*x^7 + 16*x^8 - 16*x^9 + 32*x^11 - 64*x^12 + ...
		

Crossrefs

(With different signs) row sums of triangle A104597.
Also related to A066321 and A271472.

Programs

  • Magma
    R:=PowerSeriesRing(Rationals(), 50); Coefficients(R!(Laplace( Exp(-x)*Cos(x) ))); // G. C. Greubel, Jul 22 2018; Apr 17 2023
    
  • Maple
    A009116 := n->add((-1)^j*binomial(n,2*j),j=0..floor(n/2));
  • Mathematica
    n = 50; (* n = 2 mod 4 *) (CoefficientList[ Series[ Cos[x]/Exp[x], {x, 0, n}], x]* Table[k!, {k,0,n-1}] )[[1 ;; 45]] (* Jean-François Alcover, May 18 2011 *)
    Table[(1/2)*((-1-I)^n + (-1+I)^n), {n,0,50}] (* Jean-François Alcover, Jan 31 2018 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 + x) / (1 + 2*x + 2*x^2) + x * O(x^n), n))} /* Michael Somos, Nov 17 2002 */
    
  • SageMath
    def A009116(n): return 2^(n/2)*chebyshev_T(n, -1/sqrt(2))
    [A009116(n) for n in range(41)] # G. C. Greubel, Apr 17 2023

Formula

Real part of (-1-i)^n. See A009545 for imaginary part. - Marc LeBrun
a(n) = -2 * (a(n-1) + a(n-2)); a(0)=1, a(1)=-1. - Michael Somos, Nov 17 2002
G.f.: (1 + x) / (1 + 2*x + 2*x^2).
E.g.f.: cos(x) / exp(x).
a(n) = Sum_{k=0..n} (-1)^k*A098158(n,k). - Philippe Deléham, Dec 04 2006
a(n)*(-1)^n = A099087(n) - A099087(n-1). - R. J. Mathar, Nov 18 2007
a(n) = (-1)^n*A146559(n). - Philippe Deléham, Dec 01 2008
From Paul Curtz, Jul 22 2011: (Start)
a(n) = -4*a(n-4).
a(n) = A016116(n) * A075553(n+6). (End)
E.g.f.: cos(x)/exp(x) = 1 - x/(G(0)+1), where G(k) = 4k+1-x+(x^2)*(4k+1)/((2k+1)*(4k+3)-(x^2)+x*(2k+1)*(4k+3)/( 2k+2-x+x*(2k+2)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 24 2011
G.f.: G(0)/2, where G(k) = 1 + 1/(1 - x*(k+1)/(x*(k+2) - 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 20 2013
a(n) = (-1)^n*2^(n/2)*cos(n*Pi/4). - Nordine Fahssi, Dec 18 2013
a(n) = (-1)^floor((n+1)/2)*2^(n-1)*H(n, n mod 2, 1/2) for n >= 3 where H(n, a, b) = hypergeom([a - n/2, b - n/2], [1 - n], 2). - Peter Luschny, Sep 03 2019
a(n) = 2^(n/2)*ChebyshevT(n, -1/sqrt(2)). - G. C. Greubel, Apr 17 2023
a(n) = A108520(n-1)+A108520(n). - R. J. Mathar, May 09 2023

Extensions

Extended with signs by Olivier Gérard, Mar 15 1997
Definition corrected by Joerg Arndt, Apr 29 2011

A066321 Binary representation of base-(i-1) expansion of n: replace i-1 with 2 in base-(i-1) expansion of n.

Original entry on oeis.org

0, 1, 12, 13, 464, 465, 476, 477, 448, 449, 460, 461, 272, 273, 284, 285, 256, 257, 268, 269, 3280, 3281, 3292, 3293, 3264, 3265, 3276, 3277, 3088, 3089, 3100, 3101, 3072, 3073, 3084, 3085, 3536, 3537, 3548, 3549, 3520, 3521, 3532, 3533, 3344, 3345, 3356
Offset: 0

Views

Author

Marc LeBrun, Dec 14 2001

Keywords

Comments

Here i = sqrt(-1).
First differences follow a strange period-16 pattern: 1 11 1 XXX 1 11 1 -29 1 11 1 -189 1 11 1 -29 where XXX is given by A066322. Number of one-bits is A066323.
From Andrey Zabolotskiy, Feb 06 2017: (Start)
(Observations.)
Actually, the sequence of the first differences can be split into blocks of size of any power of 2, and there will be only one position in the block that does not repeat. In this sense, one may say that the first differences follow (almost-)period-2^s pattern for any s > 0.
Specifically, the first differences are given by the formula: a(n+1)-a(n) = A282137(A007814((n xor ...110011001100) + 1)). Here binary representation of n is bitwise-xored with the period-4 bit sequence (A021913 written right-to-left) which is infinite or simply long enough; A007814(m) does not depend on the bits of m other than the least significant 1.
A282137 gives all first differences in the order of decreasing occurrence frequency.
(End)
Penney shows that since (i-1)^4 = -4, the representation a(n) of a real integer n is found by writing n in base -4 using digits 0 to 3 (A007608), changing those digits to bit strings 0000, 0001, 1100, 1101 respectively, and interpreting as binary. - Kevin Ryde, Sep 07 2019

Examples

			a(4) = 464 = 2^8 + 2^7 + 2^6 + 2^4 since (i-1)^8 + (i-1)^7 + (i-1)^6 + (i-1)^4 = 4.
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 172. (See also exercise 16, p. 177; answer, p. 494.)

Crossrefs

See A271472 for the conversion of these decimal numbers to binary.
See A009116 and A009545 for real and imaginary parts of (i-1)^n (except for signs).
See A256441 for expansions of -n.

Programs

  • Maple
    f:= proc(n) option remember; local t,m;
       t:= n mod 4;
       procname(t) + 16*procname((t-n)/4)
    end proc:
    f(0):= 0: f(1):= 1: f(2):= 12: f(3):= 13:
    seq(f(i),i=0..100); # Robert Israel, Oct 21 2016
  • PARI
    a(n) = my(ret=0,p=0); while(n, ret+=[0,1,12,13][n%4+1]<Kevin Ryde, Sep 07 2019
  • Perl
    See Links section.
    
  • Python
    from gmpy2 import c_divmod
    u = ('0000','1000','0011','1011')
    def A066321(n):
        if n == 0:
            return 0
        else:
            s, q = '', n
            while q:
                q, r = c_divmod(q, -4)
                s += u[r]
            return int(s[::-1],2) # Chai Wah Wu, Apr 09 2016
    

Formula

In "rebase notation" a(n) = (i-1)[n]2.
G.f. g(z) satisfies g(z) = z*(1+12*z+13*z^2)/(1-z^4) + 16*z^4*(13+12*z^4+z^8)/((1-z)*(1+z^4)*(1+z^8)) + 256*(1-z^16)*g(z^16)/(z^12-z^13). - Robert Israel, Oct 21 2016

A342726 Niven numbers in base i-1: numbers that are divisible by the sum of their digits in base i-1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 10, 12, 15, 16, 18, 20, 24, 25, 30, 32, 33, 35, 36, 40, 42, 44, 45, 48, 50, 54, 60, 64, 65, 66, 70, 77, 80, 88, 90, 96, 99, 100, 110, 112, 120, 124, 125, 126, 130, 140, 144, 145, 147, 150, 156, 160, 168, 170, 180, 182, 184, 185, 186, 190, 192
Offset: 1

Views

Author

Amiram Eldar, Mar 19 2021

Keywords

Comments

Numbers k that are divisible by A066323(k).
Equivalently, Niven numbers in base -4, since A066323(k) is also the sum of the digits of k in base -4.

Examples

			2 is a term since its representation in base i-1 is 1100 and 1+1+0+0 = 2 is a divisor of 2.
10 is a term since its representation in base i-1 is 111001100 and 1+1+1+0+0+1+1+0+0 = 5 is a divisor of 10.
		

Crossrefs

Similar sequences: A005349 (decimal), A049445 (binary), A064150 (ternary), A064438 (quaternary), A064481 (base 5), A118363 (factorial), A328208 (Zeckendorf), A328212 (lazy Fibonacci), A331085 (negaFibonacci), A333426 (primorial), A334308 (base phi), A331728 (negabinary), A342426 (base 3/2).

Programs

  • Mathematica
    v = {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}}; q[n_] := Divisible[n, Total[Flatten @ v[[1 + Reverse @ Most[Mod[NestWhileList[(# - Mod[#, 4])/-4 &, n, # != 0 &], 4]]]]]]; Select[Range[200], q]

A342729 Self numbers in base i-1: numbers not of the form k + A066323(k).

Original entry on oeis.org

1, 3, 5, 7, 9, 22, 24, 26, 39, 41, 43, 56, 58, 60, 73, 75, 77, 90, 92, 94, 107, 109, 111, 136, 138, 140, 153, 155, 157, 170, 172, 174, 199, 201, 203, 216, 218, 220, 233, 235, 237, 262, 264, 266, 279, 281, 283, 296, 298, 300, 313, 315, 317, 330, 332, 334, 347, 349
Offset: 1

Views

Author

Amiram Eldar, Mar 19 2021

Keywords

Comments

Equivalently, self numbers in base -4, since A066323(k) is also the sum of the digits of k in base -4.
Analogous to self numbers (A003052) using base i-1 representation (A271472) instead of decimal expansion.
The number of terms not exceeding 10^k, for k=1,2,..., is 5, 20, 155, 1507, 15008, 150007, 1500014, 15000011. Is the asymptotic density of this sequence exactly 3/20?

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Similar sequences: A003052 (decimal), A010061 (binary), A010064 (base 4), A010067 (base 6), A010070 (base 8), A339211 (Zeckendorf), A339212 (dual Zeckendorf), A339213 (base phi), A339214 (factorial base), A339215 (primorial base).

Programs

  • Mathematica
    s[n_] := Module[{v = {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}}}, Plus @@ Flatten @ v[[1 + Reverse @ Most[Mod[NestWhileList[(# - Mod[#, 4])/-4 &, n, # != 0 &], 4]]]]]; f[n_] := n + s[n]; m = 1000; Complement[Range[m], Select[Union@Array[f, m], # <= m &]]

A342727 Digitally balanced numbers in base i-1: numbers that in base i-1 have the same number of 0's as 1's.

Original entry on oeis.org

2, 21, 26, 31, 36, 41, 46, 51, 310, 315, 325, 330, 335, 340, 345, 350, 355, 360, 365, 370, 375, 390, 395, 405, 410, 415, 420, 425, 430, 435, 455, 470, 475, 485, 490, 495, 535, 550, 555, 565, 570, 575, 580, 585, 590, 595, 600, 605, 610, 620, 625, 630, 635, 645
Offset: 1

Views

Author

Amiram Eldar, Mar 19 2021

Keywords

Examples

			2 is a term since its representation in base i-1, 1100, has 2 0's and 2 1's.
21 is a term since its representation in base i-1, 110011010001, has 6 0's and 6 1's.
		

Crossrefs

Similar sequences: A031443 (binary), A210619 (Zeckendorf).

Programs

  • Mathematica
    v = {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}}; balQ[n_] := Plus @@ (d = IntegerDigits[n]) == Length[d]/2; q[n_] := balQ @ FromDigits[Flatten@v[[1 + Reverse @ Most[Mod[NestWhileList[(# - Mod[#, 4])/-4 &, n, # != 0 &], 4]]]]]; Select[Range[1000], q]

A342728 a(n) is the least number k such that A066323(k) = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 23, 39, 55, 71, 87, 103, 359, 615, 871, 1127, 1383, 1639, 5735, 9831, 13927, 18023, 22119, 26215, 91751, 157287, 222823, 288359, 353895, 419431, 1468007, 2516583, 3565159, 4613735, 5662311, 6710887, 23488103, 40265319, 57042535, 73819751
Offset: 0

Views

Author

Amiram Eldar, Mar 19 2021

Keywords

Comments

a(n) is the least number k whose sum of digits in base i-1 (or in base -4) is n.

Crossrefs

Programs

  • Mathematica
    Join[{0}, LinearRecurrence[{1,0,0,0,0,16,-16}, Range[7], 50]]

Formula

a(n) = n for n <= 7, and a(n) = a(n-1) + 16*a(n-6) - 16*a(n-7) for n > 7.
G.f.: x*(1 + x + x^2 + x^3 + x^4 + x^5 - 15*x^6)/(1 - x - 16*x^6 + 16*x^7). - Stefano Spezia, Mar 20 2021
From Greg Dresden, Jun 21 2021: (Start)
a(3*n+1) = (24 + (4^n)*(25 - 9*(-1)^n))/40.
a(3*n+2) = (24 + (4^n)*(50 + 6*(-1)^n))/40.
a(3*n+3) = (24 + (4^n)*(75 + 21*(-1)^n))/40. (End)

A342725 Numbers that are palindromic in base i-1.

Original entry on oeis.org

0, 1, 13, 17, 189, 205, 257, 273, 3005, 3069, 3277, 3341, 4033, 4097, 4305, 4369, 48061, 48317, 49149, 49405, 52173, 52429, 53261, 53517, 64449, 64705, 65537, 65793, 68561, 68817, 69649, 69905, 768957, 769981, 773309, 774333, 785405, 786429, 789757, 790781, 834509
Offset: 1

Views

Author

Amiram Eldar, Mar 19 2021

Keywords

Crossrefs

Similar sequences: A002113 (decimal), A006995 (binary), A014190 (base 3), A014192 (base 4), A029952 (base 5), A029953 (base 6), A029954 (base 7), A029803 (base 8), A029955 (base 9), A046807 (factorial base), A094202 (Zeckendorf), A331191 (dual Zeckendorf), A331891 (negabinary), A333423 (primorial base).

Programs

  • Mathematica
    v = {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}}; q[n_] := PalindromeQ @ FromDigits[Flatten @ v[[1 + Reverse @ Most[Mod[NestWhileList[(# - Mod[#, 4])/-4 &, n, # != 0 &], 4]]]]]; Select[Range[0, 10^4], q]

Formula

13 is a term since its base-(i-1) presentation is 100010001 which is palindromic.

A360034 Binary representation of -n in base i-1.

Original entry on oeis.org

0, 11101, 11100, 10001, 10000, 11001101, 11001100, 11000001, 11000000, 11011101, 11011100, 11010001, 11010000, 1110100001101, 1110100001100, 1110100000001, 1110100000000, 1110100011101, 1110100011100, 1110100010001, 1110100010000, 1110111001101, 1110111001100, 1110111000001
Offset: 0

Views

Author

Jianing Song, Jan 22 2023

Keywords

Comments

Note that each Gaussian integer has one and only one base-(i-1) representation.
Also binary representation of -n in base -1-i.
Write out -n in base -4 (A212526), then change each digit 0, 1, 2, 3 to 0000, 0001, 1100, 1101 respectively.

Examples

			a(1) = 11101 since -1 = (i-1)^4 + (i-1)^3 + (i-1)^2 + (i-1)^0. Also, the base-(-4) representation of -1 is 13_(-4), so changing 1 to 0001 and 3 to 1101 yields 11101.
a(5) = 11001101 since -5 = (i-1)^7 + (i-1)^6 + (i-1)^3 + (i-1)^2 + (i-1)^0. Also, the base-(-4) representation of -5 is 23_(-4), so changing 2 to 1100 and 3 to 1101 yields 11001101.
		

Crossrefs

This is A256441 converted from base 10 to base 2. Cf. also A271472.

Programs

  • PARI
    a(n) = my(v = [-n,0], x=0, digit=0, a, b); while(v!=[0,0], a=v[1]; b=v[2]; v[1]=-2*(a\2)+b; v[2]=-(a\2); x+=(a%2)*10^digit; digit++); x \\ Jianing Song, Jan 22 2023; [a,b] represents the number a + b*(-1+i)

Formula

For n >= 1, a(4*n-0..3) = 10000 * A271472(n) + 0, 1, 1100, 1101 respectively.

A363955 When the base-2 representation of n is interpreted as a Gaussian integer x+yi in base (-1+i), both x and y are nonnegative.

Original entry on oeis.org

0, 1, 3, 8, 9, 10, 11, 12, 13, 14, 15, 64, 65, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 115, 116, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 256, 257, 258, 259
Offset: 1

Views

Author

Jeffrey Shallit, Jun 29 2023

Keywords

Examples

			9 is in the sequence, since 9 in base 2 is 1001, which is 3+2i in base (-1+i).
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge, 2003, Section 14.5.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 260], Min[ReIm[FromDigits[IntegerDigits[#, 2], I - 1]]] >= 0 &] (* Amiram Eldar, Jun 29 2023 *)

Formula

There is an automaton of 21 states that accepts the base-2 representation of members of this sequence.
Showing 1-9 of 9 results.