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 51-60 of 77 results. Next

A293292 Numbers with last digit less than 5 (in base 10).

Original entry on oeis.org

0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 30, 31, 32, 33, 34, 40, 41, 42, 43, 44, 50, 51, 52, 53, 54, 60, 61, 62, 63, 64, 70, 71, 72, 73, 74, 80, 81, 82, 83, 84, 90, 91, 92, 93, 94, 100, 101, 102, 103, 104, 110, 111, 112, 113, 114, 120, 121, 122, 123, 124, 130
Offset: 1

Views

Author

Bruno Berselli, Oct 05 2017

Keywords

Comments

Equivalently, numbers k such that floor(k/5) = 2*floor(k/10).
After 0, partial sums of A010122 starting from the 2nd term.
The sequence differs from A007091 after a(25).
Also numbers k such that floor(k/5) is even. - Peter Luschny, Oct 05 2017

Crossrefs

Cf. A010122, A239229, A257145, A293481 (complement).
Sequences of the type floor(n/d) = (10/d)*floor(n/10), where d is a factor of 10: A008592 (d=1), A197652 (d=2), this sequence (d=5), A001477 (d=10).
Sequences of the type n + r*floor(n/r): A005843 (r=1), A042948 (r=2), A047240 (r=3), A047476 (r=4), this sequence (r=5).

Programs

  • Magma
    [n: n in [0..130] | n mod 10 lt 5];
    
  • Magma
    [n: n in [0..130] | IsEven(Floor(n/5))];
    
  • Magma
    [n+5*Floor(n/5): n in [0..70]];
    
  • Maple
    select(k -> type(floor(k/5), even), [$0..130]); # Peter Luschny, Oct 05 2017
  • Mathematica
    Table[n + 5 Floor[n/5], {n, 0, 70}]
    Reap[For[k = 0, k <= 130, k++, If[Floor[k/5] == 2*Floor[k/10], Sow[k]]]][[2, 1]] (* or *) LinearRecurrence[{1, 0, 0, 0, 1, -1}, {0, 1, 2, 3, 4, 10}, 66] (* Jean-François Alcover, Oct 05 2017 *)
  • PARI
    concat(0, Vec(x^2*(1 + x + x^2 + x^3 + 6*x^4) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)) + O(x^70))) \\ Colin Barker, Oct 05 2017
    
  • PARI
    select(k->floor(k/5) == 2*floor(k/10), vector(1000, k, k)) \\ Colin Barker, Oct 05 2017
    
  • Python
    [k for k in range(131) if (k//5) % 2 == 0] # Peter Luschny, Oct 05 2017
    
  • Python
    def A293292(n): return (n-1<<1)-(n-1)%5 # Chai Wah Wu, Oct 29 2024
    
  • Sage
    [k for k in (0..130) if 2.divides(floor(k/5))] # Peter Luschny, Oct 05 2017

Formula

G.f.: x^2*(1 + x + x^2 + x^3 + 6*x^4)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4)).
a(n) = a(n-1) + a(n-5) - a(n-6).
a(n) = (n-1) + 5*floor((n-1)/5) = 10*floor((n-1)/5) + ((n-1) mod 5).
a(n) = A257145(n+2) - A239229(n-1). - R. J. Mathar, Oct 05 2017
a(n) = 2n-2-((n-1) mod 5). - Chai Wah Wu, Oct 29 2024

Extensions

Definition by David A. Corneth, Oct 05 2017

A295653 Square array T(n, k), n >= 0, k >= 0, read by antidiagonals upwards: T(n, k) = the (k+1)-th nonnegative number m such that n AND m = 0 (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 0, 1, 4, 3, 0, 4, 4, 6, 4, 0, 1, 8, 5, 8, 5, 0, 2, 2, 12, 8, 10, 6, 0, 1, 8, 3, 16, 9, 12, 7, 0, 8, 8, 10, 8, 20, 12, 14, 8, 0, 1, 16, 9, 16, 9, 24, 13, 16, 9, 0, 2, 2, 24, 16, 18, 10, 28, 16, 18, 10, 0, 1, 4, 3, 32, 17, 24, 11, 32, 17, 20
Offset: 0

Views

Author

Rémy Sigrist, Nov 25 2017

Keywords

Comments

This sequence has similarities with A126572: here we check for common bits in binary representations, there for common primes in prime factorizations.
For any n >= 0 and k >= 0:
- T(0, k) = k,
- T(1, k) = 2*k,
- T(2, k) = A042948(k),
- T(3, k) = 4*k,
- T(4, k) = A047476(k),
- T(5, k) = A047467(k),
- T(2^n - 1, k) = 2^n * k,
- T(n, 0) = 0,
- T(n, 1) = A006519(n+1),
- T(n, k + 2^A080791(n)) = T(n, k) + 2^A029837(n+1) (i.e. each row is linear),
- A000120(T(n, k)) = A000120(k).

Examples

			Square array begins:
n\k  0   1   2   3   4   5   6   7   8   9  ...
0:   0   1   2   3   4   5   6   7   8   9  ...
1:   0   2   4   6   8  10  12  14  16  18  ...
2:   0   1   4   5   8   9  12  13  16  17  ...
3:   0   4   8  12  16  20  24  28  32  36  ...
4:   0   1   2   3   8   9  10  11  16  17  ...
5:   0   2   8  10  16  18  24  26  32  34  ...
6:   0   1   8   9  16  17  24  25  32  33  ...
7:   0   8  16  24  32  40  48  56  64  72  ...
8:   0   1   2   3   4   5   6   7  16  17  ...
9:   0   2   4   6  16  18  20  22  32  34  ...
		

Crossrefs

Programs

  • PARI
    T(n,k) = if (n==0, k, n%2, 2*T(n\2,k), 2*T(n\2,k\2) + (k%2))

Formula

For any n >= 0 and k >= 0:
- T(0, k) = k,
- T(2*n + 1, k) = 2*T(n, k),
- T(2*n, 2*k) = 2*T(n, k),
- T(2*n, 2*k + 1) = 2*T(n, k) + 1.
For any n >= 0, T(n, k) ~ 2^A000120(n) * k as k tends to infinity.

A298364 Permutation of the natural numbers partitioned into quadruples [4k-2, 4k-1, 4k-3, 4k] for k > 0.

Original entry on oeis.org

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

Views

Author

Guenther Schrack, Jan 18 2018

Keywords

Comments

Partition the natural number sequence into quadruples starting with (1,2,3,4); swap the first and second elements, then swap the second and third elements; repeat for all quadruples.

Crossrefs

Inverse: A292576.
Sequence of fixed points: A008586(n) for n > 0.
First differences: (-1)^floor(n^2/4)*A068073(n-1) for n > 0.
Subsequences:
elements with odd index: A042963(A103889(n)) for n > 0.
elements with even index A014601(n) for n > 0.
odd elements: A166519(n-1) for n > 0.
indices of odd elements: A042964(n) for n > 0.
even elements: A005843(n) for n > 0.
indices of even elements: A042948(n) for n > 0.
Other similar permutations: A116966, A284307, A292576.

Programs

  • MATLAB
    a = [2 3 1 4];
    max = 10000;    % Generation of b-file.
    for n := 5:max
       a(n) = a(n-4) + 4;
    end;
    
  • Mathematica
    Nest[Append[#, #[[-4]] + 4] &, {2, 3, 1, 4}, 63] (* or *)
    Array[# + ((-1)^# + ((-1)^(# (# - 1)/2)) (1 - 2 (-1)^#))/2 &, 67] (* Michael De Vlieger, Jan 23 2018 *)
    LinearRecurrence[{1,0,0,1,-1},{2,3,1,4,6},70] (* Harvey P. Dale, Dec 12 2018 *)
  • PARI
    for(n=1, 100, print1(n + ((-1)^n + ((-1)^(n*(n-1)/2))*(1 - 2*(-1)^n))/2, ", "))

Formula

O.g.f.: (3*x^3 - 2*x^2 + x + 2)/(x^5 - x^4 - x - 1).
a(1) = 2, a(2) = 3, a(3) = 1, a(4) = 4, a(n) = a(n-4) + 4 for n > 4.
a(n) = n + ((-1)^n + ((-1)^(n*(n-1)/2))*(1 - 2*(-1)^n))/2.
a(n) = n + (cos(n*Pi) - cos(n*Pi/2) + 3*sin(n*Pi/2))/2.
a(n) = 2*floor((n+1)/2) - 4*floor((n+1)/4) + floor(n/2) + 2*floor(n/4).
a(n) = n + (-1)^floor((n-1)^2/4)*A140081(n) for n > 0.
a(n) = A056699(n+1) - 1, n > 0.
a(n+2) = A168269(n+1) - a(n), n > 0.
a(n+2) = a(n) + (-1)^floor((n+1)^2/4)*A132400(n+2) for n > 0.
Linear recurrence: a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
First differences: periodic, (1, -2, 3, 2) repeat.
Compositions:
a(n) = A080412(A116966(n-1)) for n > 0.
a(n) = A284307(A256008(n)) for n > 0.
a(A067060(n)) = A133256(n) for n > 0.
A116966(a(n+1)-1) = A092486(n) for n >= 0.
A056699(a(n)) = A256008(n) for n > 0.

A316775 a(n) is the number of permutations of [1..n] that have the same number of inversions as non-inversions.

Original entry on oeis.org

1, 1, 0, 0, 6, 22, 0, 0, 3836, 29228, 0, 0, 25598186, 296643390, 0, 0, 738680521142, 11501573822788, 0, 0, 62119523114983224, 1214967840930909302, 0, 0, 12140037056605135928410, 285899248139692651257566, 0, 0, 4759461354691529363949651814
Offset: 0

Views

Author

Tanya Khovanova, Oct 22 2018

Keywords

Comments

a(n) is zero when n choose 2 is odd, that is for numbers that have remainders 2 or 3 when divided by 4.

Examples

			Consider a permutation 1432. It has exactly three pairs of numbers, the first of them is 1, that are in increasing order. The other three pairs are in decreasing order. The other 5 permutations of size 4 with this property are 2341, 2413, 3142, 3214, 4123. Thus a(4) = 6.
		

Crossrefs

Formula

a(n) = A000140(n) if n in { A042948 }. - Alois P. Heinz, Oct 25 2018

Extensions

a(10)-a(15) from Giovanni Resta, Oct 22 2018
a(16)-a(28) from Alois P. Heinz, Oct 24 2018

A320919 Positive integers k such that binomial(k, 3) is divisible by 6.

Original entry on oeis.org

1, 2, 9, 10, 18, 20, 28, 29, 36, 37, 38, 45, 46, 54, 56, 64, 65, 72, 73, 74, 81, 82, 90, 92, 100, 101, 108, 109, 110, 117, 118, 126, 128, 136, 137, 144, 145, 146, 153, 154, 162, 164, 172, 173, 180, 181, 182, 189, 190, 198, 200
Offset: 1

Views

Author

Tanya Khovanova, Oct 24 2018

Keywords

Comments

When taken modulo 36 this sequence is periodic with period is 9.
These are numbers for which a 3-symmetric permutation of size n might exist.
Numbers for which a 2-symmetric permutations might exist are numbers n such that n choose 2 is even. Equivalently, these are numbers that have remainder 0 or 1 modulo 4. This is sequence A042948.

Examples

			For k=8, binomial(8,3) = 56, which is not divisible by 6. Therefore 8 is not in the sequence.
For k=9, binomial(9,3) = 84, which is divisible by 6, so 9 is a term of the sequence.
		

Crossrefs

Programs

  • GAP
    Filtered([1..200],k->Binomial(k,3) mod 6 = 0); # Muniru A Asiru, Oct 24 2018
  • Maple
    select(k->modp(binomial(k,3),6)=0,[$1..200]); # Muniru A Asiru, Oct 24 2018
  • Mathematica
    Transpose[Select[Table[{n, IntegerQ[Binomial[n, 3]/3!]}, {n, 200}], #[[2]] == True &]][[1]]
  • PARI
    select(n->binomial(n, 3)%6 == 0, vector(100, n, n)) \\ Colin Barker, Oct 24 2018
    
  • PARI
    Vec(x*(1 + x + 7*x^2 + x^3 + 8*x^4 + 2*x^5 + 8*x^6 + x^7 + 7*x^8) / ((1 - x)^2*(1 + x + x^2)*(1 + x^3 + x^6)) + O(x^40)) \\ Colin Barker, Oct 24 2018
    

Formula

From Colin Barker, Oct 24 2018: (Start)
G.f.: x*(1 + x + 7*x^2 + x^3 + 8*x^4 + 2*x^5 + 8*x^6 + x^7 + 7*x^8) / ((1 - x)^2*(1 + x + x^2)*(1 + x^3 + x^6)).
a(n) = a(n-1) + a(n-9) - a(n-10) for n>10.
(End)

A329952 Numbers k such that binomial(k,3) is divisible by 8.

Original entry on oeis.org

0, 1, 2, 8, 10, 16, 17, 18, 24, 26, 32, 33, 34, 40, 42, 48, 49, 50, 56, 58, 64, 65, 66, 72, 74, 80, 81, 82, 88, 90, 96, 97, 98, 104, 106, 112, 113, 114, 120, 122, 128, 129, 130, 136, 138, 144, 145, 146, 152, 154, 160, 161, 162, 168, 170, 176, 177, 178, 184, 186, 192, 193, 194
Offset: 1

Views

Author

Sebastian Jeon and Tanya Khovanova, Nov 25 2019

Keywords

Comments

These are possible sizes for 3-symmetric graphs.
The possible size of 2-symmetric graphs is sequence A042948.
These numbers are 0, 1, 2, 8, and 10 modulo 16.

Examples

			binomial(10, 3) = 120, which is divisible by 8. Thus 10 belongs to this sequence.
		

Crossrefs

Cf. A042948.

Programs

  • Mathematica
    Select[Range[200],Mod[Floor[#(#-1)(#-2)/6],8]==0&] (* Joshua Oliver, Nov 26 2019 *)
    LinearRecurrence[{1,0,0,0,1,-1},{0,1,2,8,10,16},80] (* Harvey P. Dale, Jul 03 2022 *)
  • PARI
    for(k=0,194,my(j=binomial(k,3));if(!(j%8),print1(k,", "))) \\ Hugo Pfoertner, Nov 29 2019
    
  • PARI
    concat(0, Vec(x^2*(1 + x + 6*x^2 + 2*x^3 + 6*x^4) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)) + O(x^70))) \\ Colin Barker, Nov 29 2019
  • Python
    for n in range(200):
        if (n*(n-1)*(n-2)//6)%8==0:
            print(n, end=' ')
    

Formula

G.f.: (6*x^4+2*x^3+6*x^2+x+1)*x^2/(x^6-x^5-x+1). - Alois P. Heinz, Nov 29 2019
a(n) = a(n-1) + a(n-5) - a(n-6) for n>6. - Colin Barker, Nov 29 2019

A338502 Lexicographically earliest sequence of distinct nonnegative integers such that for any n > 0, a(1) XOR ... XOR a(n) is a square (where XOR denotes the bitwise XOR operator).

Original entry on oeis.org

0, 1, 5, 4, 9, 8, 17, 16, 25, 24, 37, 21, 33, 20, 13, 45, 32, 29, 40, 48, 65, 36, 53, 72, 61, 52, 80, 57, 93, 64, 85, 49, 81, 88, 56, 96, 117, 100, 68, 125, 105, 116, 101, 120, 112, 73, 89, 137, 84, 109, 141, 180, 113, 133, 160, 132, 161, 152, 121, 144, 128
Offset: 1

Views

Author

Rémy Sigrist, Oct 31 2020

Keywords

Comments

All terms belong to A042948.

Examples

			The first terms, alongside a(1) XOR ... XOR a(n), are:
  n   a(n)  a(1) AND ... AND a(n)
  --  ----  ---------------------
   1     0                0 = 0^2
   2     1                1 = 1^2
   3     5                4 = 2^2
   4     4                0 = 0^2
   5     9                9 = 3^2
   6     8                1 = 1^2
   7    17               16 = 4^2
   8    16                0 = 0^2
   9    25               25 = 5^2
  10    24                1 = 1^2
  11    37               36 = 6^2
  12    21               49 = 7^2
		

Crossrefs

Cf. A042948, A042964, A292388 (prime variant), A338503.

Programs

  • PARI
    See Links section.

A355278 Lower left of the Cayley table for the primes when made into a group using the bijection (2, 3, 5, 7, ...) -> (0, +1, -1, +2, ...) into (Z, +); read by rows.

Original entry on oeis.org

2, 3, 7, 5, 2, 11, 7, 13, 3, 19, 11, 5, 17, 2, 23, 13, 19, 7, 29, 3, 37, 17, 11, 23, 5, 31, 2, 41, 19, 29, 13, 37, 7, 43, 3, 53, 23, 17, 31, 11, 41, 5, 47, 2, 59, 29, 37, 19, 43, 13, 53, 7, 61, 3, 71, 31, 23, 41, 17, 47, 11, 59, 5, 67, 2, 73, 37, 43, 29
Offset: 1

Views

Author

M. F. Hasler, Sep 08 2022

Keywords

Comments

The primes can be given the structure of a group via a bijection with the group (Z, +). The simplest such bijection is to assign the integers (0, 1, -1, 2, -2, ...) to the primes, in increasing order, i.e., the composition of the prime counting function A000720, decreased by 1, with the canonical enumeration A001057.
Since this is an abelian group, the table (an infinite square matrix) is symmetric, T(m,n) = T(n,m), and it is sufficient to list only the lower left part, m >= n >= 1.
Each row and each column (of the complete square matrix) is a permutation of the primes, as always for Cayley tables. The inverse of a prime p, for the group operation *, is found at the top of the column in which 2 appears in the row starting with p, cf. 3rd formula.
Other simple bijections from the primes into (Z, +) would be to associate the negative integers to the primes congruent to 1 (mod 4) or to those congruent to 1 (mod 3), and the nonnegative integers to the others, in increasing order.

Examples

			The correspondence of primes p with integers m is as follows:
   p |  2 |  3 |  5 |  7 | 11 | 13 | 17 | 19 | 23 | 29 | 31 | ...
  ---+----+----+----+----+----+----+----+----+----+----+----+----
   m |  0 |  1 | -1 |  2 | -2 |  3 | -3 |  4 | -4 |  5 | -5 | ...
The table of the abelian group (P, *) based on this correspondence with (Z, +) starts as follows:
  [ 2  3  5  7 11 13 17 ...]
  [ 3  7  2 13  5 19 11 ...]
  [ 5  2 11  3 17  7 23 ...]
  [ 7 13  3 19  2 29  5 ...]
  [11  5 17  2 23  3 31 ...]
  [13 19  7 29  3 37  2 ...]
  [17 11 23  5 31  2 41 ...]
  [...    ...    ...    ...]
This means that 3 * 3 = 7, 3 * 5 = 2, 3 * 7 = 13, etc.: for example, primes 3 and 7 are associated to integers 1 and 2, so 3 * 7 is the prime associated to the integer 1 + 2 = 3, which yields 13.
Since 2, associated to 0 in Z, is the neutral element in the group (P, *), the first row and column is identical to the list of the primes themselves. Therefore we do not need to show row and columns headings in addition to the first row & column of the body of the table.
Since the table is symmetric,  T(m,n) = T(n,m)  <=>  p * q = q * p, the sequence lists only the lower left part: 2; 3, 7; 5, 2, 11; 7, 13, 3, 19; ...
The list of inverses of the primes 2, 3, 5, 7, 11, ... with respect to this group operation is 2, 5, 3, 11, 7, 17, 13, ... = A000040(A065190(n)), i.e., after the initial 2, list the primes with the two members of each subsequent pair swapped: swap 3 and 5, 7 and 11, 13 and 17, etc.
		

Crossrefs

Programs

  • PARI
    A355278(m,n) = inv(f(prime(m))+f(prime(n)))
    inv(x, p)=while(!mapisdefined(INV,x,&p), mapput(INV, f(p=prime(#INV+1)), p)); p
    INV=Map(); f(p)=(p=primepi(p))\2*(-1)^(p%2)

Formula

T(m, n) = T(n, m), so only m >= n >= 1 is listed: row m has length m.
T(n, n) = A000040(A042948(n)) = A000040(A014601(n-1)+1)
T(m, 1) * T(k, 1) = 2 (neutral element of the group operation *) <=> T(k, 1) is the inverse of T(m, 1) <=> T(m, k) = 2.

A374081 Expansion of Product_{k>=1} (1 - x^(4*k-3)) * (1 - x^(4*k)).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Jun 27 2024

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 85; CoefficientList[Series[Product[(1 - x^(4 k - 3)) (1 - x^(4 k)), {k, 1, nmax}], {x, 0, nmax}], x]
    a[0] = 1; a[n_] := a[n] = -(1/n) Sum[DivisorSum[k, # &, Or[Mod[#, 4] == 0, Mod[#, 4] == 1] &] a[n - k], {k, 1, n}]; Table[a[n], {n, 0, 85}]

A131911 2*A131821 - A128174.

Original entry on oeis.org

1, 4, 3, 5, 2, 5, 8, 1, 2, 7, 9, 2, 1, 2, 9, 12, 1, 2, 1, 2, 11, 13, 2, 1, 2, 1, 2, 13, 16, 1, 2, 1, 2, 1, 2, 15, 17, 2, 1, 2, 1, 2, 1, 2, 17, 20, 1, 2, 1, 2, 1, 2, 1, 2, 19
Offset: 1

Views

Author

Gary W. Adamson, Jul 27 2007

Keywords

Comments

Left column, congruent to {0, 1} mod 4, A042948: (1, 4, 5, 8, 9, 12, 13, 16, ...).
Row sums = A131912: (1, 7, 12, 18, 23, 29, 34, ...).

Examples

			First few rows of the triangle:
   1;
   4,  3;
   5,  2,  5;
   8,  1,  2,  7;
   9,  2,  1,  2,  9;
  12,  1,  2,  1,  2, 11;
  13,  2,  1,  2,  1,  2, 13;
  ...
		

Crossrefs

Formula

2*A131821 - A128174 as infinite lower triangular matrices.
Previous Showing 51-60 of 77 results. Next