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 41-48 of 48 results.

A340383 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(n) = [A278222(A304759(n)), A278222(A291759(n))], for all i, j >= 1.

Original entry on oeis.org

1, 2, 1, 3, 4, 5, 2, 6, 7, 3, 3, 8, 1, 9, 2, 10, 11, 6, 4, 12, 11, 13, 3, 14, 9, 15, 3, 16, 12, 17, 3, 18, 3, 3, 7, 19, 3, 9, 19, 19, 6, 3, 5, 8, 12, 20, 1, 21, 8, 22, 12, 23, 11, 24, 12, 25, 6, 8, 26, 27, 12, 13, 12, 28, 13, 29, 4, 12, 9, 20, 26, 30, 31, 22, 10, 16, 5, 14, 6, 32, 33, 8, 3, 12, 10, 23, 15, 14, 19, 8
Offset: 1

Views

Author

Antti Karttunen, Jan 16 2021

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A340381(n), A340382(n)], or equally, of the function f(n) = A290093(A048673(n)).
For all i, j: a(i) = a(j) => A286586(i) = A286586(j) => A286585(i) = A286585(j).

Crossrefs

Programs

  • PARI
    up_to = 65537;
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A048673(n) = (A003961(n)+1)/2;
    A289814(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==2, 1, 0)), 2); } \\ From A289814
    A291759(n) = A289814(A048673(n));
    A289813(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==1, 1, 0)), 2); } \\ From A289813
    A304759(n) = A289813(A048673(n));
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    Aux340383(n) = [A278222(A291759(n)),A278222(A304759(n))];
    v340383 = rgs_transform(vector(up_to,n,Aux340383(n)));
    A340383(n) = v340383[n];

A374362 a(n) is the least term t of A005836 such that n - t also belongs to A005836.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 3, 3, 4, 0, 0, 1, 0, 0, 1, 3, 3, 4, 9, 9, 10, 9, 9, 10, 12, 12, 13, 0, 0, 1, 0, 0, 1, 3, 3, 4, 0, 0, 1, 0, 0, 1, 3, 3, 4, 9, 9, 10, 9, 9, 10, 12, 12, 13, 27, 27, 28, 27, 27, 28, 30, 30, 31, 27, 27, 28, 27, 27, 28, 30, 30, 31, 36, 36, 37, 36
Offset: 0

Views

Author

Rémy Sigrist, Jul 06 2024

Keywords

Comments

To compute a(n): in the ternary expansion of n, replace 1's by 0's and 2's by 1's.

Examples

			The first terms, in decimal and in ternary, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     0       1          0
   2     1       2          1
   3     0      10          0
   4     0      11          0
   5     1      12          1
   6     3      20         10
   7     3      21         10
   8     4      22         11
   9     0     100          0
  10     0     101          0
  11     1     102          1
  12     0     110          0
  13     0     111          0
  14     1     112          1
  15     3     120         10
		

Crossrefs

Programs

  • PARI
    a(n) = fromdigits(apply(d -> [0, 0, 1][1+d], digits(n, 3)), 3)
    
  • Python
    from gmpy2 import digits
    def A374362(n): return int(digits(n,3).replace('1','0').replace('2','1'),3) # Chai Wah Wu, Jul 09 2024

Formula

a(n) = A374361(n, 0).
a(n) = n - A374363(n).
a(n) >= 0 with equality iff n belongs to A374361.
a(n) = A005836(1 + A289814(n)).

A289869 Square array T(n,k) (n>=0, k>=0) read by antidiagonals downwards: T(n,k) = A005836(n) + 2*A005836(k).

Original entry on oeis.org

0, 2, 1, 6, 3, 3, 8, 7, 5, 4, 18, 9, 9, 6, 9, 20, 19, 11, 10, 11, 10, 24, 21, 21, 12, 15, 12, 12, 26, 25, 23, 22, 17, 16, 14, 13, 54, 27, 27, 24, 27, 18, 18, 15, 27, 56, 55, 29, 28, 29, 28, 20, 19, 29, 28, 60, 57, 57, 30, 33, 30, 30, 21, 33, 30, 30, 62, 61, 59
Offset: 1

Views

Author

Rémy Sigrist, Jul 14 2017

Keywords

Comments

If n and k have no common one bit in base 2 representation (n AND k = 0), then n = A289813(T(n,k)) and k = A289814(T(n,k)).
This sequence, when restricted to the pairs of numbers without common bits in base 2 representation, is the inverse of the function n -> (A289813(n), A289814(n)).

Examples

			The table begins:
x\y:    0   1   2   3   4   5   6   7   8   9  ...
0:      0   2   6   8   18  20  24  26  54  56 ...
1:      1   3   7   9   19  21  25  27  55  57 ...
2:      3   5   9   11  21  23  27  29  57  59 ...
3:      4   6   10  12  22  24  28  30  58  60 ...
4:      9   11  15  17  27  29  33  35  63  65 ...
5:      10  12  16  18  28  30  34  36  64  66 ...
6:      12  14  18  20  30  32  36  38  66  68 ...
7:      13  15  19  21  31  33  37  39  67  69 ...
8:      27  29  33  35  45  47  51  53  81  83 ...
9:      28  30  34  36  46  48  52  54  82  84 ...
...
		

Crossrefs

Programs

  • PARI
    T(n,k) = fromdigits(binary(n),3) + 2*fromdigits(binary(k),3)
    
  • Python
    def T(n, k): return int(bin(n)[2:], 3) + 2*int(bin(k)[2:], 3)
    for n in range(11): print([T(k, n - k) for k in range(n + 1)]) # Indranil Ghosh, Aug 03 2017

A317805 Lexicographically earliest sequence of nonnegative terms such that for any n > 0 and k > 0, a(n) AND a(n + k) <> a(n + 2*k) (where AND denotes the bitwise AND operator).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 07 2018

Keywords

Comments

This sequence has similarities with A276204: here we consider the bitwise AND operator, there the addition operator.
Apparently, the variant where we use the bitwise OR operator corresponds, up to a change of offset, to A289814.
The scatterplot of the sequence has fractal features (see illustrations in Links section).

Examples

			For n = 10:
- a(10-2*1) AND a(10-1) = 2 AND 2 = 2,
- a(10-2*2) AND a(10-2) = 1 AND 2 = 0,
- a(10-2*3) AND a(10-3) = 1 AND 1 = 1,
- a(10-2*4) AND a(10-4) = 0 AND 1 = 0,
- hence a(10) = 3.
		

Crossrefs

A332413 a(n) is the imaginary part of f(n) = Sum_{d_k > 0} 3^k * i^(d_k-1) where Sum_{k >= 0} 5^k * d_k is the base 5 representation of n and i denotes the imaginary unit. Sequence A332412 gives real parts.

Original entry on oeis.org

0, 0, 1, 0, -1, 0, 0, 1, 0, -1, 3, 3, 4, 3, 2, 0, 0, 1, 0, -1, -3, -3, -2, -3, -4, 0, 0, 1, 0, -1, 0, 0, 1, 0, -1, 3, 3, 4, 3, 2, 0, 0, 1, 0, -1, -3, -3, -2, -3, -4, 9, 9, 10, 9, 8, 9, 9, 10, 9, 8, 12, 12, 13, 12, 11, 9, 9, 10, 9, 8, 6, 6, 7, 6, 5, 0, 0, 1, 0
Offset: 0

Views

Author

Rémy Sigrist, Feb 12 2020

Keywords

Examples

			For n = 103:
- 103 = 4*5^2 + 3*5^0,
- so f(123) = 3^2 * i^(4-1) + 3^0 * i^(3-1) = -1 - 9*i,
- and a(n) = -9.
		

Crossrefs

Cf. A031219, A289814, A332412 (real parts and additional comments).

Programs

  • PARI
    a(n) = { my (d=Vecrev(digits(n,5))); imag(sum (k=1, #d, if (d[k], 3^(k-1)*I^(d[k]-1), 0))) }

Formula

a(n) = 0 iff the n-th row of A031219 has neither 2's nor 4's.
a(5*n) = 3*a(n).
a(5*n+1) = 3*a(n).
a(5*n+2) = 3*a(n) + 1.
a(5*n+3) = 3*a(n).
a(5*n+4) = 3*a(n) - 1.

A340684 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(n) = [A291759(n), A278222(A304759(n))], for all i, j >= 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 16 2021

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A291759(n), A278222(A304759(n))].
For all i, j: a(i) = a(j) => A340383(i) = A340383(j).

Crossrefs

Programs

  • PARI
    up_to = 65537;
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A048673(n) = (A003961(n)+1)/2;
    A289814(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==2, 1, 0)), 2); } \\ From A289814
    A291759(n) = A289814(A048673(n));
    A289813(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==1, 1, 0)), 2); } \\ From A289813
    A304759(n) = A289813(A048673(n));
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    Aux340684(n) = [A291759(n),A278222(A304759(n))];
    v340684 = rgs_transform(vector(up_to,n,Aux340684(n)));
    A340684(n) = v340684[n];

A366794 Binary encoding of the twos (-1's) in the balanced ternary representation of Per Nørgård's "infinity sequence".

Original entry on oeis.org

0, 0, 1, 1, 0, 0, 2, 0, 1, 1, 0, 0, 1, 1, 2, 0, 0, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 2, 3, 3, 1, 1, 0, 0, 1, 1, 2, 0, 0, 0, 1, 1, 0, 0, 2, 0, 1, 1, 2, 0, 1, 1, 0, 0, 2, 0, 1, 1, 0, 2, 4, 2, 0, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 2, 3, 3, 0, 0, 1, 1, 0, 0, 2, 0, 1, 1, 0, 0, 1, 1, 2, 0, 2, 0, 0, 0, 0, 2, 3, 3, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Oct 24 2023

Keywords

Comments

The composer Per Nørgård's name is also written in the OEIS as Per Noergaard.

Examples

			A004718(254) = -7. In balanced ternary representation (see A117966) this is represented as -1*9 + 1*3 + -1*1. Taking the negative coefficients, and converting them to a binary string gives "101", which in base-2 (A007088) is equal to 5, therefore a(254) = 5.
		

Crossrefs

Programs

Formula

a(n) = A289814(A323909(n)).

A293450 Restricted growth sequence transform of (3*A293225(n) + A010872(n)), a filter combining (n mod 3) with two products, the other formed from the 1-digits (A293221) and the other from the 2-digits (A293222) present in the ternary expansions of proper divisors of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 06 2017

Keywords

Crossrefs

Programs

  • PARI
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A289813(n) = { my (d=digits(n, 3)); from digits(vector(#d, i, if (d[i]==1, 1, 0)), 2); };
    A289814(n) = { my (d=digits(n, 3)); from digits(vector(#d, i, if (d[i]==2, 1, 0)), 2); };
    A293221(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289813(d)))); m; };
    A293222(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289814(d)))); m; };
    Anot_submitted(n) = (1/2)*(2 + ((A293222(n) + A293221(n))^2) - A293222(n) - 3*A293221(n)); \\ Eq.class-wise equal to A293225.
    Anot2submitted(n) = ((3*Anot_submitted(n))+(n%3));
    write_to_bfile(1,rgs_transform(vector(59049,n,Anot2submitted(n))),"b293450.txt");

Formula

For all i, j: a(i) = a(j) => A002324(i) = A002324(j).
Previous Showing 41-48 of 48 results.