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 11-20 of 21 results. Next

A338872 Square array of distinct positive integers T(n, k), n > 0, k > 0, read by antidiagonals upwards, filled the greedy way such that for any n > 0 and k > 0, Sum_{ i = 1..n, j = 1..k } T(i, j) is divisible by n * k.

Original entry on oeis.org

1, 3, 5, 2, 7, 6, 10, 12, 8, 4, 9, 16, 19, 14, 24, 11, 15, 31, 27, 18, 20, 13, 17, 21, 43, 30, 22, 38, 23, 33, 41, 47, 40, 48, 26, 46, 36, 63, 35, 39, 88, 70, 44, 62, 45, 32, 66, 55, 71, 52, 60, 28, 42, 29, 51, 25, 86, 90, 67, 98, 56, 54, 34, 73, 91, 57
Offset: 1

Views

Author

Rémy Sigrist, Nov 13 2020

Keywords

Comments

This sequence is a 2-dimensional variant of A019444.

Examples

			Array T(n, k) begins:
  n\k|   1   2   3    4    5    6    7    8    9   10
  ---+-----------------------------------------------
    1|   1   5   6    4   24   20   38   46   45   51
    2|   3   7   8   14   18   22   26   62   29   91
    3|   2  12  19   27   30   48   44   42   73   53
    4|  10  16  31   43   40   70   28   34   61   37
    5|   9  15  21   47   88   60   54  106   77  133
    6|  11  17  41   39   52   56   50  118  129  157
    7|  13  33  35   71   98  116  173  117  181  213
    8|  23  63  55   67   82  136  155  187  141  161
    9|  36  66  90   84   99  111  179  143  146  256
   10|  32  86  74  124  109  121  203  235   78  188
		

Crossrefs

See A338918 and A338919 for similar sequences.
Cf. A019444.

Programs

  • PARI
    See Links section.

A054081 Array T by antidiagonals: for n >= 0 and k >= 1, let p(k)=least positive integer not already in a(i), q(k)=p(k)+k+n-1, a(p(k))=q(k), a(q(k))=p(k); then for h>=1, T(n,h)=a(h).

Original entry on oeis.org

1, 3, 2, 2, 1, 3, 6, 5, 5, 4, 8, 7, 1, 6, 5, 4, 3, 8, 8, 7, 6, 11, 10, 2, 1, 9, 8, 7, 5, 4, 11, 11, 11, 10, 9, 8, 14, 13, 13, 2, 1, 12, 11, 10, 9, 16, 15, 4, 14, 14, 14, 13, 12, 11, 10, 7, 6, 16, 3, 2, 1, 15, 14, 13, 12, 11, 19, 18, 18, 17, 17, 17, 17, 16, 15, 14, 13, 12
Offset: 1

Views

Author

Keywords

Comments

Each row is a self-inverse permutation of N; are the numbers in every column distinct?

Examples

			Row 0: 1 3 2 6 8 4 11 ... = A019444.
Row 1: 2 1 5 7 3 10 4 ... = A002251.
Row 2: 3 5 1 8 2 11 13 ...
		

Extensions

More terms from Sean A. Irvine, Jan 24 2022

A293835 a(n) = smallest number (in absolute value) not yet in the sequence such that the arithmetic mean of the first n terms a(1), a(2), ..., a(n) is an integer; a(1)=1. No two numbers with the same absolute value may appear. Preference is given to positive values of a(n).

Original entry on oeis.org

1, 3, 2, 6, -7, -5, 0, 8, 10, 12, 14, 4, -9, -11, -13, -15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 16, -18, -20, -22, -24, -26, -28, -30, -32, -34, -36, -38, -40, -42, -44, -46, -48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78
Offset: 1

Views

Author

Enrique Navarrete, Oct 16 2017

Keywords

Comments

For n=1: 1/1 is an integer, and so is -1/1, but preference is given to positive values of a(n).
Fixed points so far: 1,8,17,50; i.e., aside from 1, these fixed points occur when sequence changes from 0 to positive or from negative to positive.
One could check the integers in order of appearance in A001057 to see if they are the next term. - David A. Corneth, Nov 13 2017

Examples

			For n=7: (1 + 3 + 2 + 6 - 7 - 5 + 0)/7 is an integer.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = For[k = 0, True, k++, aa = Array[a, n - 1]; If[FreeQ[aa, k | -k], If[IntegerQ[Mean[Append[aa, k]]], Return[k]]; If[IntegerQ[Mean[Append[aa, -k]]], Return[-k]]]];
    Array[a, 100] (* Jean-François Alcover, Dec 09 2017 *)

A296099 Lexicographically earliest sequence of distinct positive terms such that, for any n > 0, SumXOR_{k=1..n} a(k) is divisible by n, where SumXOR is the analog of summation under the binary XOR operation.

Original entry on oeis.org

1, 3, 2, 4, 11, 9, 6, 8, 19, 5, 21, 7, 12, 14, 16, 30, 17, 39, 15, 45, 20, 22, 56, 46, 25, 87, 31, 33, 74, 36, 32, 62, 66, 96, 34, 72, 109, 37, 78, 54, 42, 44, 40, 86, 90, 116, 112, 94, 49, 85, 100, 52, 171, 61, 126, 60, 75, 67, 89, 65, 71, 13, 70, 124, 128
Offset: 1

Views

Author

Rémy Sigrist, Dec 04 2017

Keywords

Comments

The partial XOR sums are given by A295907.
This sequence is a "binary" variant of A019444.
This sequence has connections with A286681; graphically, both sequences have similar fractal features; in the scatterplot of the current sequence, the rays emerging from the origin correspond to the numerous terms a(n) that are multiples of n.

Crossrefs

Programs

  • PARI
    s = 0; x = 0; for (n=1, 65, for (k=1, oo, if (!bittest(s,k) && (xx=bitxor(x,k))%n==0, x = xx; s += 2^k; print1 (k ", "); break)))

A371220 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, a(1) + ... + a(n) is a multiple of n, and the least value not yet in the sequence appears as soon as possible.

Original entry on oeis.org

1, 3, 2, 10, 4, 52, 5, 43, 6, 54, 7, 65, 8, 76, 9, 103, 11, 99, 12, 110, 13, 121, 14, 132, 15, 143, 16, 154, 17, 165, 18, 176, 19, 187, 20, 198, 21, 209, 22, 220, 23, 231, 24, 242, 25, 253, 26, 264, 27, 275, 28, 286, 29, 297, 30, 308, 31, 319, 32, 330, 33, 341
Offset: 1

Views

Author

Rémy Sigrist, Mar 15 2024

Keywords

Comments

To build the sequence:
- we start with a(1) = 1,
- once we have n terms, let v be the least value not yet in the sequence,
- if a(1) + ... a(n) + v is a multiple of n+1, then a(n+1) = v,
- otherwise a(n+2) = v and a(n+1) is chosen as small as possible so as to meet the required conditions (this is always possible as n+1 and n+2 are coprime).
The construction is similar to that of A367288.
This sequence is a variant of A019444 and, by design, is guaranteed to be a permutation of the nonnegative integers (with inverse A371221).

Examples

			The first terms, alongside the average of the first terms, are:
  n   a(n)  (a(1)+...+a(n))/n
  --  ----  -----------------
   1     1                  1
   2     3                  2
   3     2                  2
   4    10                  4
   5     4                  4
   6    52                 12
   7     5                 11
   8    43                 15
   9     6                 14
  10    54                 18
  11     7                 17
  12    65                 21
		

Crossrefs

Cf. A019444, A367288, A371221 (inverse).

Programs

  • PARI
    See Links section.

A382169 A382168 with duplicates removed.

Original entry on oeis.org

0, 1, 7, 17, 38, 74, 119, 185, 263, 368, 504, 657, 847, 1078, 1331, 1631, 1956, 2334, 2769, 3234, 3762, 4323, 4953, 5656, 6397, 7217, 8120, 9066, 10101, 11182, 12358, 13633, 14959, 16390, 17930, 19526, 21237, 23007, 24898, 26914, 28994, 31205, 33483, 35898
Offset: 1

Views

Author

N. J. A. Sloane, Mar 31 2025

Keywords

Comments

Is there any other characterization of these numbers?
First differences are triangular numbers whose indices (in A000217) are 1,3,4,6,8,9,11,12,14,16,17,19,21,22,24,25,27,29,30,32,33,35,37,38,40,42. - Ivan N. Ianakiev, Apr 01 2025

Crossrefs

Extensions

More terms from Pontus von Brömssen, Apr 01 2025

A125147 a(0)=1; for n >= 1, a(n) is the smallest positive integer not occurring earlier in the sequence such that Sum_{k=0..n} a(k) is a multiple of n.

Original entry on oeis.org

1, 2, 3, 6, 4, 9, 5, 12, 14, 7, 17, 8, 20, 22, 10, 25, 11, 28, 30, 13, 33, 35, 15, 38, 16, 41, 43, 18, 46, 19, 49, 51, 21, 54, 56, 23, 59, 24, 62, 64, 26, 67, 27, 70, 72, 29, 75, 77, 31, 80, 32, 83, 85, 34, 88, 90, 36, 93, 37, 96, 98, 39, 101, 40, 104, 106, 42, 109, 111, 44
Offset: 0

Views

Author

Leroy Quet, Jan 11 2007

Keywords

Comments

Sequence A019444 is a similar sequence, but it has an offset of 1 and a(1) =1 instead.
This sequence is a permutation of the positive integers. This can be proved using the theorem-prover Walnut. - Jeffrey Shallit, Aug 12 2023

Examples

			a(5) = 9 because 9 is the smallest positive integer m which does not occur earlier in the sequence and which is such that 5 divides m + Sum_{k=0..4} a(k).
So Sum_{k=0..5} a(k) = 25, which is divisible by 5.
		

Crossrefs

Cf. A019444.

Programs

  • Mathematica
    f[l_List] := Block[{k = 1, n = Length[l], s = Plus @@ l},While[MemberQ[l, k] || Mod[s + k, n] > 0, k++ ];Append[l, k]];Nest[f, {1}, 70] (* Ray Chandler, Jan 23 2007 *)

Extensions

Extended by Ray Chandler, Jan 23 2007

A236247 Sequence of distinct least squares such that the arithmetic mean of the first n squares is also a square.

Original entry on oeis.org

1, 49, 25, 121, 784, 196, 33124, 4900, 4, 4356, 2304324, 213444, 2371600, 379456, 87616, 360000, 3802500, 562500, 100, 532900, 5456896, 767376, 5934096, 992016, 9947716, 1350244, 32467204, 44100, 2414916, 10458756, 2683044
Offset: 1

Views

Author

Derek Orr, Jan 20 2014

Keywords

Examples

			a(1) = 1.
a(2) is the smallest unused square such that (a(2)+a(1))/2 is a square. So, a(2) = 49.
a(3) is the smallest unused square such that (a(3)+a(2)+a(1))/3 is a square. So, a(3) = 25.
...and so on.
		

Crossrefs

Programs

  • Python
    def Sq(x):
      for n in range(10**15):
        if x == n**2:
          return True
        if x < n**2:
          return False
      return False
    def SqAve(init):
      print(init)
      lst = []
      lst.append(init)
      n = 1
      while n < 10**9:
        if n**2 not in lst:
          if Sq(((sum(lst)+n**2)/(len(lst)+1))):
            print(n**2)
            lst.append(n**2)
            n = 1
          else:
            n += 1
        else:
          n += 1
    SqAve(1)

Formula

a(n) = A141391(n)^2

A356255 a(1) = 1; for n > 1, a(n) is the smallest magnitude number not occurring earlier such that n is divisible by s = Sum_{k = 1..n} a(k), where |s| > 1.

Original entry on oeis.org

1, -3, -1, 5, 3, -2, 4, -5, 7, -4, 6, -7, 9, -6, 8, -11, 13, -8, 10, -9, 11, -10, 12, -15, -13, 18, 14, -20, 22, -14, 16, -23, -19, 28, -12, -17, -25, 35, 15, -18, -36, 20, -22, 21, 17, -41, 93, -31, 33, -24, 26, -38, 40, -26, -16, -39, 25, 32, 30, -29, 31, -30, -28, 29, -27, 61, -133, 50, -52, 34
Offset: 1

Views

Author

Scott R. Shannon, Oct 15 2022

Keywords

Comments

The sequence is finite - after 2020 terms, a(2020) = -669, the sum of all terms is 4 so the next term would have to be 4 less than the divisors with magnitude > 1 of 2021, namely 2017, 43, 39, -47, -51, -2025. However these six numbers have all previously occurred so the sequence terminates.

Examples

			a(7) = 4 as Sum_{k = 1..7} a(k) = 1 - 3 - 1 + 5 + 3 - 2 + 4 = 7, and 4 is the smallest magnitude number not occurring earlier that forms a sum with magnitude > 1 that is a divisor of 7.
		

Crossrefs

Cf. A019444 (sum of terms is divisible by n), A027749, A027750.

A318280 A permutation of the positive integers defined in the comment section such that the sum of the first n terms of the sequence is divisible by n.

Original entry on oeis.org

1, 3, 2, 10, 4, 220, 5, 235, 6, 354, 7, 497, 8, 664, 9, 1143, 11, 79117, 12, 2445932, 13, 87580535, 14, 3572000558, 15, 163703541857, 16, 8336823369072, 17, 467409009871723, 18, 28624087521132434, 19, 1901883146740912949, 20
Offset: 1

Views

Author

Jinyuan Wang, Aug 23 2018

Keywords

Comments

Start the sequence at a(1) = 1. For each n, if the sum of the first 2n-1 terms is S(n), then define a(2n+1) to be the smallest positive integer that has not appeared in {a(1), a(2), ..., a(2n-1)}, and a(2n) = a(2n+1)*[(2n+1)^t-1] - S(n), where t is the smallest positive integer that makes a(2n) > a(2n-2) (if n = 1, choose t = 1). [Simplified and corrected by Jianing Song, Oct 04 2019]
This is a sequence of positive integers in which each number occurs exactly once such that for each n = 1,2,3,... the sum of the first n terms of the sequence is divisible by n.
If we always choose the smallest candidate for each a(n), we get A019444. - Jianing Song, Oct 04 2019
Is a(2n-1) = A183301(n)? - Dmitry Kamenetsky, Jul 11 2019 [Answer: No, because a(37) = 21 while A183301(19) = 22. - Jianing Song, Oct 04 2019]

Examples

			The first term is 1. So S(1) = 1, a(3) = 2.
This gives a(2) = 2*(3^t-1) - 1 = 3, here t = 1. So S(2) = 6, a(5) = 4.
This gives a(4) = 4*(5^t-1) - 6 = 10 > a(2), here t = 1. So S(3) = 20, a(7) = 5.
This gives a(6) = 5*(7^t-1) - 20 = 220 > a(4), here t = 2. So S(4) = 245, a(9) = 6.
...
S(7) = 2025, a(17) = 11, so a(16) = 11*(17^t-1) - 2025 = 1143 > a(14) = 664, here t = 2. [Rewritten by _Jianing Song_, Oct 04 2019]
		

Crossrefs

Cf. A019444.

Extensions

Incorrect definition removed by Jianing Song, Oct 04 2019
Previous Showing 11-20 of 21 results. Next