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.

Previous Showing 21-30 of 48 results. Next

A242483 Numbers n such that A242481(n) = ((n*(n+1)/2) mod n + sigma(n) mod n + antisigma(n) mod n) / n = 2.

Original entry on oeis.org

4, 8, 10, 14, 16, 22, 26, 32, 34, 36, 38, 44, 46, 48, 50, 52, 58, 60, 62, 64, 68, 72, 74, 76, 82, 84, 86, 90, 92, 94, 96, 98, 106, 108, 110, 116, 118, 122, 124, 128, 130, 132, 134, 136, 142, 144, 146, 148, 152, 154, 156, 158, 164, 166, 168, 170, 172, 178, 182
Offset: 1

Views

Author

Jaroslav Krizek, May 16 2014

Keywords

Comments

Numbers n such that A242480(n) = (n*(n+1)/2) mod n + sigma(n) mod n + antisigma(n) mod n = (A142150(n) + A054024(n) + A229110(n)) = ((A000217(n) mod n) + (A000203(n) mod n) + (A024816(n) mod n)) = 2n. Numbers n such that A242481(n) = (A142150(n) + A054024(n) + A229110(n)) / n = ((A000217(n) mod n) + (A000203(n) mod n) + (A024816(n) mod n)) / n = 2.
Conjecture: with number 1 complement of A242482.

Examples

			8 is in sequence because [(8*(8+1)/2) mod 8 + sigma(8) mod 8 + antisigma(8) mod 8] / 8 = (36 mod 8 + 15 mod 8 + 21 mod 8) / 8 = (4 + 7 + 5 ) / 8 = 2.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..1000] | 2 eq (((n*(n+1)div 2 mod n + SumOfDivisors(n) mod n + (n*(n+1)div 2-SumOfDivisors(n)) mod n)))div n]

A276457 a(n) is the number of times that a(n-1) appears in the concatenation of all numbers from a(0) to a(n-2), with a(0) = 0.

Original entry on oeis.org

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

Views

Author

Yuriy Sibirmovsky, Sep 03 2016

Keywords

Comments

138, 185 and 199 are three smallest numbers that do not appear among the first 5000 terms of the sequence. They first appear at n = 8776, 5117 and 10580 respectively.
1187 and 1190 are two smallest numbers that do not appear among the first 100000 terms.
Question: will every natural number eventually appear in the sequence?
The sequence can be started with any number a(0). The terms will be different, but for larger n behavior will be similar for all a(0).

Examples

			From a(0) to a(0), a(1) appears once, thus a(2) = 1.
From a(0) to a(1), a(2) appears 0 times, thus a(3) = 0.
...
From a(0) to a(19), a(20) = 10 appears once, in the form of '1,0'. Thus a(21) = 1.
		

Crossrefs

Similar in spirit to van Eck's A181391.

Programs

  • Mathematica
    Nm=100;
    A=Table[0,{j,1,Nm}];
    A[[3]]=1;
    Do[B=Table[IntegerDigits[A[[l]]],{l,1,j-1}];
    A[[j+1]]=SequenceCount[Flatten[B],IntegerDigits[A[[j]]]],{j,3,Nm-1}];
    A

Formula

a(n) = A142150(n) = A171181(n), if 0<=n<=20.
a(n) = A248034(n-19), if 21<=n<=120. - Omar E. Pol, Sep 03 2016

A086099 a(n) = OR(k AND (n-k): 0<=k<=n), AND and OR bitwise.

Original entry on oeis.org

0, 0, 1, 0, 3, 2, 3, 0, 7, 6, 7, 4, 7, 6, 7, 0, 15, 14, 15, 12, 15, 14, 15, 8, 15, 14, 15, 12, 15, 14, 15, 0, 31, 30, 31, 28, 31, 30, 31, 24, 31, 30, 31, 28, 31, 30, 31, 16, 31, 30, 31, 28, 31, 30, 31, 24, 31, 30, 31, 28, 31, 30, 31, 0, 63, 62, 63, 60, 63, 62, 63, 56, 63, 62
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 09 2003

Keywords

Comments

a(2^n - 1) = 0, a(3*2^n - 1) = 2^n;
A086100(n) = A007088(a(n)).

Examples

			a(4) = (0 AND 4) OR (1 AND 3) OR (2 AND 2) OR (3 AND 1) OR (4 AND 0) -> (000 AND 100) OR (001 AND 011) OR (010 AND 010) OR (011 AND 001) OR (111 AND 000) = 000 OR 011 OR 010 OR 011 OR 000 = 011 -> a(4)=3.
		

Crossrefs

Cf. A003817 (even bisection), A062383.
Cf. A086100 (in binary), A007088.

Programs

  • Haskell
    import Data.Bits ((.&.), (.|.))
    a086099 n = foldl1 (.|.) $ zipWith (.&.) [0..] $ reverse [0..n] :: Integer
    -- Reinhard Zumkeller, Jun 04 2012
    
  • Mathematica
    a[n_] := BitOr @@ Table[BitAnd[k, n - k], {k, 0, n}]; Table[a[n], {n, 0, 73}] (* Jean-François Alcover, Jun 19 2012 *)
  • PARI
    a(n) = n++; 1<Kevin Ryde, Apr 11 2023

Formula

a(2*n) = 2*2^floor(log_2(n)) - 1 = A003817(n).
a(2*n+1) = 2*a(n).
a(n) = A053644(n+1) - A006519(n+1). - Ridouane Oudra, Apr 09 2023

A115514 Triangle read by rows: row n >= 1 lists first n positive terms of A004526 (integers repeated) in decreasing order.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 3, 2, 2, 1, 1, 3, 3, 2, 2, 1, 1, 4, 3, 3, 2, 2, 1, 1, 4, 4, 3, 3, 2, 2, 1, 1, 5, 4, 4, 3, 3, 2, 2, 1, 1, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1
Offset: 1

Views

Author

Roger L. Bagula, Mar 07 2006

Keywords

Comments

T(n,k) = number of 2-element subsets of {1,2,...,n+2} such that the absolute difference of the elements is k+1, where 1 <= k < = n. E.g., T(7,3) = 3, the subsets are {1,5}, {2,6}, and {3,7}. - Christian Barrientos, Jun 27 2022

Examples

			Triangle begins as, for n >= 1, 1 <= k <= n,
  1;
  1, 1;
  2, 1, 1;
  2, 2, 1, 1;
  3, 2, 2, 1, 1;
  3, 3, 2, 2, 1, 1;
  4, 3, 3, 2, 2, 1, 1;
  ...
		

Crossrefs

Cf. A002620 (row sums), A008805 (diagonal sums), A142150 (alternating row sums)

Programs

  • Magma
    [Floor((n-k+2)/2): k in [1..n], n in [1..15]]; // G. C. Greubel, Mar 14 2024
    
  • Maple
    # Assuming offset 0:
    Even := n -> (1 + (-1)^n)/2: # Iverson's even.
    p := n -> add(add(Even(k)*x^j, j = 0..n-k), k = 0..n):
    for n from 0 to 9 do seq(coeff(p(n), x, k), k=0..n) od; # Peter Luschny, Jun 03 2021
  • Mathematica
    Table[Floor[(n-k+2)/2], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Mar 14 2024 *)
  • SageMath
    flatten([[(n-k+2)//2 for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Mar 14 2024

Formula

Sum_{k=1..n} T(n, k) = A002620(n+1) (row sums). - Gary W. Adamson, Oct 25 2007
T(n, k) = [x^k] p(n), where p(n) are partial Gaussian polynomials (A008967) defined by p(n) = Sum_{k=0..n} Sum_{j=0..n-k} even(k)*x^j, and even(k) = 1 if k is even and otherwise 0. We assume offset 0. - Peter Luschny, Jun 03 2021
T(n, k) = floor((n+2-k)/2). - Christian Barrientos, Jun 27 2022
From G. C. Greubel, Mar 14 2024: (Start)
T(n, k) = A128623(n, k)/n.
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = A142150(n+1).
Sum_{k=1..floor((n+1)/2)} T(n-k+1, k) = A008805(n-1).
Sum_{k=1..floor((n+1)/2)} (-1)^(k-1)*T(n-k+1, k) = A002265(n+3). (End)

Extensions

Edited by N. J. A. Sloane, Mar 23 2008 and Dec 15 2017

A142149 a(n) = XOR{k OR (n-k): 0<=k<=n}.

Original entry on oeis.org

0, 1, 3, 3, 6, 5, 5, 7, 12, 9, 15, 11, 10, 13, 9, 15, 24, 17, 27, 19, 30, 21, 29, 23, 20, 25, 23, 27, 18, 29, 17, 31, 48, 33, 51, 35, 54, 37, 53, 39, 60, 41, 63, 43, 58, 45, 57, 47, 40, 49, 43, 51, 46, 53, 45, 55, 36, 57, 39, 59, 34, 61, 33, 63, 96, 65, 99, 67, 102, 69, 101, 71
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 15 2008

Keywords

Comments

a(n) = XOR{k AND (n-k): 0<=k<=n}.

Crossrefs

Programs

  • Haskell
    import Data.Bits (xor, (.|.))
    a142149 :: Integer -> Integer
    a142149 = foldl xor 0 . zipWith (.|.) [0..] . reverse . enumFromTo 1
    -- Reinhard Zumkeller, Mar 31 2015
    
  • PARI
    a(n)=if(n%2, n, bitxor(n, n/2)) \\ Charles R Greathouse IV, Jul 01 2022
  • Python
    def A142149(n): return n if n&1 else (n^ n>>1) # Chai Wah Wu, Jun 29 2022
    

Formula

a(2*n) = A048724(n) and a(2*n+1) = A005408(n).

A180714 Sum of the x- and y-coordinates of a point moving in a clockwise spiral.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

A spiral on the simple square grid is constructed starting at (0,0) and walking in the closest self-avoiding clockwise loop: up 1 unit, right 1 unit, down 2 units, left 2 units, up 3 units etc. The step widths in the x-coordinate are 0, 1, 0, -2, 0, 3, ... a signed version of A142150; the step widths in the y-coordinate are 1, 0, -2, 0, 3, ... The x-coordinate after n steps (n>=0) is a signed variant of A002265(n+3), namely 0, 0, 1, 1, -1, -1, 2, 2, -2, -2, 3, ...; the y-coordinate after n steps is 0, 1, 1, -1, -1, 2, 2, ... (n >= 0). The sum of the x- and y-coordinates after n steps (at corners of the spiral) is c(n) = 0, 1, 2, 0, -2, 1, 4, 0, -4, 1, 6, 0, -6, 1, 8, 0, ..., with g.f. -x*(1+x)/( (x-1)*(x^2+1)^2). The current sequence is obtained by recording the sum of the two coordinates at all intermediate positions walking with a stride of 1 along the edges of the spiral, equivalent to showing all interpolating integers between two values of c(n). The first differences a(n+1)-a(n) are two 1's, four -1's, six 1's, eight -1's etc., blocks of +1 and -1 with run lengths increasing by 2. - R. J. Mathar, Jan 22 2011

Examples

			Spiral begins at x=0, y=0, then moves up-right-down-left-up-right-...
a(0)=0+0=0, a(1)=1+0=1, a(2)=1+1=2, a(3)=0+1=1, a(4)=-1+1=0, a(5)=-1+0=-1, ...
		

Crossrefs

A191967 n * (numbers that are not divisible by 3).

Original entry on oeis.org

0, 1, 4, 12, 20, 35, 48, 70, 88, 117, 140, 176, 204, 247, 280, 330, 368, 425, 468, 532, 580, 651, 704, 782, 840, 925, 988, 1080, 1148, 1247, 1320, 1426, 1504, 1617, 1700, 1820, 1908, 2035, 2128, 2262, 2360, 2501, 2604, 2752, 2860, 3015, 3128, 3290, 3408
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 07 2012

Keywords

Comments

A033579 and A033570 interleaved.

Crossrefs

Programs

Formula

a(n) = n * A001651(n).
a(n) = A000326(n) - A142150(n).
a(2*n) = A033579(n) = 4 * A000326(n);
a(2*n+1) = A033570(n) = A000326(2*n+1).
G.f.: x*(1+3*x+6*x^2+2*x^3)/((1+x)^2*(1-x)^3). - Bruno Berselli, Jul 09 2012
a(n) = A182079(3n). - Bruno Berselli, Jul 09 2012
From Amiram Eldar, Feb 18 2022: (Start)
Sum_{n>=1} 1/a(n) = Pi/(4*sqrt(3)) + 9*log(3)/4 - 2*log(2).
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(3)*Pi/4 + 3*log(3)/4 - 2*log(2). (End)

A242485 Possible values of A242480(n) in increasing order.

Original entry on oeis.org

0, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 35, 37, 39, 40, 41, 42, 43, 44, 45, 47, 49, 51, 52, 53, 54, 55, 56, 57, 59, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 83
Offset: 1

Views

Author

Jaroslav Krizek, May 27 2014

Keywords

Comments

A242480(n) = (n*(n+1)/2) mod n + sigma(n) mod n + antisigma(n) mod n = A142150(n) + A054024(n) + A229110(n) = (A000217(n) mod n) + (A000203(n) mod n) + (A024816(n) mod n).
Supersequence of odd numbers > 1. Complement of A242486.

Examples

			16 is in the sequence because there is a number m such that A242480(m) = 16; m = 8.
		

Crossrefs

A242486 Numbers n such that A242480(x) = n has no solution.

Original entry on oeis.org

1, 4, 10, 14, 22, 26, 34, 36, 38, 46, 48, 50, 58, 60, 62, 74, 82, 84, 86, 90, 94, 98, 106, 108, 110, 118, 122, 130, 132, 134, 142, 146, 154, 156, 158, 166, 170, 178, 182, 190, 194, 202, 206, 210, 214, 218, 226, 230, 238, 242, 250, 252, 254, 262, 266, 270, 274
Offset: 1

Views

Author

Jaroslav Krizek, May 27 2014

Keywords

Comments

A242480(n) = (n*(n+1)/2) mod n + sigma(n) mod n + antisigma(n) mod n = A142150(n) + A054024(n) + A229110(n) = (A000217(n) mod n) + (A000203(n) mod n) + (A024816(n) mod n).
All values of a(n) are even for n > 1. Complement of A242485.

Examples

			14 is in the sequence because there is no x whose A242480(x) = 14.
		

Crossrefs

A267120 Triangle of coefficients of Gaussian polynomials [2n+3,3]_q represented as finite sum of terms (1+q^2)^k*q^(g-k), where k = 0,1,...,g with g=3n.

Original entry on oeis.org

1, 0, -1, 1, 1, -1, 0, 5, -2, -4, 1, 1, 0, 2, -2, -15, 7, 17, -5, -7, 1, 1, 1, 0, -15, 6, 53, -23, -67, 22, 38, -8, -10, 1, 1, 0, -3, 3, 55, -28, -189, 81, 261, -90, -182, 46, 68, -11, -13, 1, 1, -1, 0, 30, -12, -229, 106, 691, -292, -1010, 359, 817, -229, -387, 79, 107, -14, -16, 1, 1
Offset: 0

Views

Author

Stephen O'Sullivan, Jan 10 2016

Keywords

Comments

The entry a(n,k), n >= 0, k = 0,1,...,g, where g=3n, of this irregular triangle is the coefficient of (1+q^2)^k*q^(g-k) in the representation of the Gaussian polynomial [2n+3,3]q = Sum{k=0..g) a(n,k)*(1+q^2)^k*q^(g-k).
Row n is of length 3n+1.
The sequence arises in the formal derivation of the stability polynomial B(x) = Sum_{i=0..N} d_i T(iM,x) of rank N, and degree L, where T(iM,x) denotes the Chebyshev polynomial of the first kind of degree iM (A053120). The coefficients d_i are determined by order conditions on the stability polynomial.
Conjecture: More generally, the Gaussian polynomial [2*n+m+1-(m mod 2),m]q = Sum{k=0..g(m;n)} a(m;n,k)*(1+q^2)^k*q^(g(m;n)-k), for m >= 0, n >= 0, where g(m;n) = m*n if m is odd and (2*n+1)*m/2 if m is even, and the tabf array entries a(m;n,k) are the coefficients of the g.f. for the row n polynomials G(m;n,x) = (d^m/dt^m)G(m;n,t,x)/m!|{t=0}, with G(m;n,t,x) = (1+t)*Product{k=1..n+(m - m (mod 2))/2}(1 + t^2 + 2*t*T(k,x/2) (Chebyshev's T-polynomials). Hence a(m;n,k) = [x^k]G(m;n,x), for k=0..g(m;n). The present entry is the instance m = 3. (Thanks to Wolfdieter Lang for clarifying the text on the general prescription of a(m;n,k).)
From Robert Israel, Jan 15 2016: (Start)
a(n,0) = A056594(n).
a(n,1) = (-1)^((n+1)/2) * A142150(n+1).
a(2n,2) = 5*(-1)^(n+1)*A000217(n), a(2n+1,2) =(-1)^n*(n+1).
It appears that Sum_{j=0..k+1} C(k+1,j)*a(n+2*j,k) = 0.
(End)

Examples

			The irregular triangle a(n, k) begins:
n/k 0  1   2   3   4    5   6   7   8   9  10 11 12
0:  1
1:  0 -1   1   1
2: -1  0   5  -2  -4   1    1
3:  0  2  -2 -15   7   17  -5  -7   1   1
4:  1  0 -15   6  53  -23 -67  22  38  -8 -10  1  1
...
Row n=5: 0 -3   3  55 -28 -189  81 261 -90 -182  46 68 -11 -13 1 1;
Row n=6: -1  0 30 -12 -229  106 691 -292 -1010 359 817 -229 -387 79 107 -14 -16 1 1.
Row n=7: 0 4 -4 -134 70 896 -416 -2561 1073 3903 -1415 -3529 1057 1991 -467 -709 121 155 -17 -19 1 1.
... Reformatted and extended. - _Wolfdieter Lang_, Feb 13 2016
		

Crossrefs

Programs

  • Maple
    A267120 := proc (n, k) local y: y := expand(subs(t = 0, diff((1+t)*product(1+t^2+2*t*ChebyshevT(i, x/2), i = 1 .. n+1),t$3)/3!)): if k = 0 then subs(x = 0, y) else subs(x = 0, diff(y, x$k)/k!) end if: end proc: seq(seq(A267120(n, k), k = 0 .. 3*n), n = 0 .. 20);
    # More efficient:
    N:= 20: # to get rows 0 to N
    P[0]:= (1+t)*(t^2 + t*x + 1):
    B[0]:= 1:
    for n from 1 to N do
      P[n]:= expand(series(P[n-1]*(1+t^2+2*t*orthopoly[T](n+1,x/2)),t,4));
      B[n]:= coeff(P[n],t,3);
    od:
    seq(seq(coeff(B[n],x,j),j=0..3*n),n=0..N); # Robert Israel, Jan 15 2016
  • Mathematica
    row[n_] := 1/3! D[(1+t)*Product[1+t^2+2*t*ChebyshevT[i, x/2], {i, 1, n+1}], {t, 3}] /. t -> 0 // CoefficientList[#, x]&; Table[row[n], {n, 0, 6}] // Flatten (* Jean-François Alcover, Jan 16 2016 *)

Formula

G.f. for row polynomial: G(n,x) = (d^3/dt^3)((1+t)*Product_{i=1..n+1}(1+t^2+2t*T(i,x/2))/3!)|_{t=0}.
Previous Showing 21-30 of 48 results. Next