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

A099507 a(n) is such that A099506(a(n)) = n.

Original entry on oeis.org

1, 4, 2, 6, 17, 3, 10, 5, 12, 7, 14, 53, 9, 8, 11, 22, 13, 24, 15, 26, 99, 103, 28, 107, 30, 19, 32, 111, 16, 23, 18, 25, 42, 20, 29, 46, 31, 48, 33, 50, 209, 35, 211, 56, 37, 58, 217, 39, 60, 21, 41, 64, 43, 66, 245, 45, 72, 47, 74, 49, 27, 51, 34, 267, 80, 36, 82, 277, 38, 57
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 20 2004

Keywords

Comments

a(199) > 10^6 if it exists. - Robert Israel, Jun 17 2015

Examples

			Gives the positions in the sequence A099506 at which the integers n>0 appear. That sequence begins: 1,3,6,2,8,4,... so a(1)=1, a(2)=4, a(3)=2, etc.
		

Crossrefs

Cf. A099506.

Programs

  • MATLAB
    N = 10^6;
    M = 10*N;  % search up to A099506(N) while A099507 < M
    % returns 0 for entries not found
    B = zeros(1, M);
    A = zeros(1, N);
    A(1) = 1;
    B(1) = 1;
    for n = 2:N
      t = mod(-A(n-1)-1,n)+1;
      bm = t + [0:floor((M-t)/n)]*n;
      bz = find(B(bm)==0,1);
      if numel(bz)==0
          break
      end
      m = t + n*(bz-1);
      A(n) = m;
      B(m) = n;
    end;
    B(1:1000) % Robert Israel, Jun 17 2015

A099518 RECORDS transform of A099506.

Original entry on oeis.org

1, 3, 6, 8, 10, 14, 15, 17, 19, 29, 31, 34, 50, 61, 63, 66, 69, 72, 79, 94, 96, 124, 131, 192, 225, 300, 353, 399, 433, 623, 632, 636, 795, 799, 806, 813, 1027, 1092, 1419, 1436, 1440, 1448, 1483, 1875, 2236, 2244, 2450, 2494, 2776, 2827, 3253, 3494, 4113, 4491
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 20 2004

Keywords

Examples

			A099506 starts with: 1,3,6,2,8,4,10,14,13,7,15,... so the records are 1,3,6,8,10,14,15,...
		

Crossrefs

A099519 Positions in A099506 of the values in the RECORDS transform of that sequence (A099518).

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 11, 13, 15, 16, 18, 20, 21, 27, 34, 36, 38, 40, 44, 52, 54, 55, 59, 68, 101, 108, 128, 181, 197, 224, 281, 283, 288, 359, 363, 367, 368, 493, 510, 643, 645, 649, 665, 676, 800, 804, 876, 892, 990, 1008, 1017, 1250, 1476, 1614, 1676, 2140, 2286
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 20 2004

Keywords

Examples

			Sequence A099506 is 1,3,6,2,8,4,10,14,13,7,15,... so the records are (A099518) 1,3,6,8,10,14,15,... which appear in positions 1,2,3,5,7,8,11,....
		

Crossrefs

Formula

A099506(a(n))=A099518(n).

A125717 a(0)=0; thereafter a(n) = the smallest nonnegative integer not already in the sequence such that a(n-1) is congruent to a(n) (mod n).

Original entry on oeis.org

0, 1, 3, 6, 2, 7, 13, 20, 4, 22, 12, 23, 11, 24, 10, 25, 9, 26, 8, 27, 47, 5, 49, 72, 48, 73, 21, 75, 19, 77, 17, 79, 15, 81, 115, 45, 117, 43, 119, 41, 121, 39, 123, 37, 125, 35, 127, 33, 129, 31, 131, 29, 133, 80, 134, 189, 245, 74, 16, 193, 253, 70, 132, 69, 197, 67, 199, 65
Offset: 0

Views

Author

Leroy Quet, Feb 01 2007

Keywords

Comments

This sequence seems likely to be a permutation of the nonnegative integers.
A245340(n) = smallest m such that a(m) = n, or -1 if n never appears.
See A245394 and A245395 for record values of a(n) and where they occur. - Reinhard Zumkeller, Jul 21 2014
See A370956 and A370959 for record values of the inverse A245340 and where they occur. - N. J. A. Sloane, Apr 29 2024
A very nice (maybe the most natural) variant of Recamán's sequence A005132. - M. F. Hasler, Nov 03 2014

Crossrefs

Cf. A245340 (inverse), A370957 (first differences), A245394 & A245395 (records in this sequence), A370956 & A370959 (records in inverse).
See also A005132 (Recaman), A099506, A125715, A125718, A125725.

Programs

  • Haskell
    import Data.IntMap (singleton, member, (!), insert)
    a125717 n = a125717_list !! n
    a125717_list =  0 : f [1..] 0 (singleton 0 0) where
       f (v:vs) w m = g (reverse[w-v,w-2*v..1] ++ [w+v,w+2*v..]) where
         g (x:xs) = if x `member` m then g xs else x : f vs x (insert x v m)
    -- Reinhard Zumkeller, Jul 21 2014
    
  • Mathematica
    f[l_List] := Block[{n = Length[l], k = Mod[l[[ -1]], n]},While[MemberQ[l, k], k += n];Append[l, k]];Nest[f, {0}, 70] (* Ray Chandler, Feb 04 2007, updated for change to offset Oct 10 2019 *)
  • PARI
    {Quet_p2(n)=/* Permutation sequence a'la Leroy Quet, A125717 */local(x=[1],k=0,w=1); for(i=2,n,if((k=x[i-1]%i)==0,k=i);while(bittest(w,k-1)>0,k+=i);x=concat(x,k);w+=2^(k-1)); return(x)} \\ Ferenc Adorjan
    
  • PARI
    A125717(n,show=0)={my(u=1,a);for(n=1,n,a%=n;while(bittest(u,a),a+=n);u+=1<M. F. Hasler, Nov 03 2014
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        an, aset = 0, {0}
        for n in count(1):
            yield an
            an = next(m for m in count(an%n, n) if m not in aset)
            aset.add(an)
    print(list(islice(agen(), 70))) # Michael S. Branicky, Jun 07 2023

Extensions

Extended by Ray Chandler, Feb 04 2007
a(0) added by Franklin T. Adams-Watters, Mar 31 2014
Edited by N. J. A. Sloane, Mar 15 2024

A099520 a(1)=1; for n>1, a(n)=smallest integer m>0 not yet appearing in sequence such that m+a(n-1) is a multiple of n-1.

Original entry on oeis.org

1, 2, 4, 5, 3, 7, 11, 10, 6, 12, 8, 14, 22, 17, 25, 20, 28, 23, 13, 44, 16, 26, 18, 51, 21, 29, 49, 32, 24, 34, 56, 37, 27, 39, 63, 42, 30, 81, 33, 45, 35, 47, 79, 50, 38, 52, 40, 54, 90, 57, 43, 59, 97, 9, 99, 66, 46, 68, 48, 70, 110, 73, 113, 76, 116, 144, 120, 148, 124, 83
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 20 2004

Keywords

Examples

			a(1)=1. a(2)=2 because a(2)+a(1)=2+1=3 which is a multiple of 1. Could not use a(2)=1 since 1 has already been used. a(3)=4 so that a(3)+a(2)=4+2=6 which is a multiple of 2, etc.
		

Crossrefs

Cf. A099506 for similar sequence with a(n)+a(n-1)=multiple of n.

A371214 Lexicographically earliest sequence of distinct nonnegative integers such that for any n > 0, a(n-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

0, 1, 7, 2, 22, 3, 45, 4, 76, 5, 115, 6, 18, 8, 216, 9, 279, 10, 350, 11, 429, 12, 516, 13, 611, 14, 714, 15, 825, 16, 944, 17, 47, 19, 1205, 20, 1348, 21, 55, 23, 1657, 24, 1824, 25, 1999, 26, 2182, 27, 2373, 28, 2572, 29, 2779, 30, 2994, 31, 3217, 32, 3448
Offset: 0

Views

Author

Rémy Sigrist, Mar 15 2024

Keywords

Comments

To build the sequence:
- we start with a(0) = 0, and repeatedly:
- let a(n) be the last known term and v the least value not yet in the sequence,
- if 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 in such a way as to satisfy the required congruences (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 A099506 and, by design, is guaranteed to be a permutation of the nonnegative integers (with inverse A371215).

Examples

			The first terms are:
  n   a(n)  (a(n-1) + a(n))/n
  --  ----  -----------------
   0     0  N/A
   1     1                  1
   2     7                  4
   3     2                  3
   4    22                  6
   5     3                  5
   6    45                  8
   7     4                  7
   8    76                 10
   9     5                  9
  10   115                 12
  11     6                 11
  12    18                  2
		

Crossrefs

Cf. A099506, A367288, A371215 (inverse).

Programs

  • PARI
    See Links section.

A294734 Lexicographically earliest sequence of distinct positive odd numbers such that, for any n > 1, n divides a(n-1) + a(n).

Original entry on oeis.org

1, 3, 9, 7, 13, 5, 23, 17, 19, 11, 33, 15, 37, 47, 43, 21, 81, 27, 49, 31, 53, 35, 57, 39, 61, 69, 93, 75, 41, 79, 45, 51, 147, 91, 119, 25, 123, 29, 127, 73, 173, 121, 137, 83, 97, 87, 101, 139, 155, 95, 109, 99, 113, 103, 117, 107, 235, 55, 63, 177, 67, 181
Offset: 1

Views

Author

Rémy Sigrist, Nov 07 2017

Keywords

Comments

This sequence is a variant of A099506 and of A134204.
The variant where "n divides a(n) + a(n+1)" corresponds to A005408 (the odd numbers).
Empirically, the scatterplot of the first terms shows a bundle of curves that correspond to terms sharing the same value of Sum_{k=2.. n} ((-1)^k (a(k+1) + a(k))/k) (see Links section); the sequence A134204 has similar features.

Crossrefs

Programs

  • PARI
    See Links section.

A099521 a(n) is such that A099520(a(n))=n.

Original entry on oeis.org

1, 2, 5, 3, 4, 9, 6, 11, 54, 8, 7, 10, 19, 12, 72, 21, 14, 23, 84, 16, 25, 13, 18, 29, 15, 22, 33, 17, 26, 37, 156, 28, 39, 30, 41, 190, 32, 45, 34, 47, 218, 36, 51, 20, 40, 57, 42, 59, 27, 44, 24, 46, 284, 48, 286, 31, 50, 292, 52, 77, 300, 79, 35, 81, 85, 56, 87, 58, 89, 60
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 20 2004

Keywords

Examples

			Gives the positions in the sequence A099520 at which the integers n>0 appear. A099520 begins: 1,2,4,5,3,7,11,10,6,12,8,..., so the positions of the integers are: 1,2,5,3,4,9,6,...
		

Crossrefs

Cf. A099520. Also A099506 and A099507 for sequences based on a slightly different definition.
Showing 1-8 of 8 results.