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

A371094 a(n) = m*(2^e) + ((4^e)-1)/3, where m = 3n+1, and e is the 2-adic valuation of m.

Original entry on oeis.org

1, 21, 7, 21, 13, 341, 19, 45, 25, 117, 31, 69, 37, 341, 43, 93, 49, 213, 55, 117, 61, 5461, 67, 141, 73, 309, 79, 165, 85, 725, 91, 189, 97, 405, 103, 213, 109, 1877, 115, 237, 121, 501, 127, 261, 133, 1109, 139, 285, 145, 597, 151, 309, 157, 5461, 163, 333, 169, 693, 175, 357, 181, 1493, 187, 381, 193, 789, 199
Offset: 0

Views

Author

Antti Karttunen (proposed by Ali Sada), Apr 19 2024

Keywords

Comments

Construction: take the binary expansion of 3n+1 (A016777(n)), and substitute "01" for all trailing 0-bits that follow after its odd part (= A067745(1+n)), of which there are A371093(n) in total. See the examples.

Examples

			For n=1, 3*n+1 = 4, "100" in binary, when we substitute 01's for the two trailing 0's, we obtain 21, "10101" in binary, therefore a(1) = 21.
For n=6, 3*6+1 = 19, "10011" in binary, and there are no trailing 0's, and no changes, therefore a(6) = 19.
For n=7, 3*7+1 = 22, "10110" in binary, with one trailing 0, which when replaced with 01 gives us 45, "101101" in binary, therefore a(7) = 45.
For n=229, there are e=4 trailing bit expansions 0 -> 01,
  3n+1 = binary  101011  0 0 0 0
  a(n) = binary  101011 01010101
		

Crossrefs

Cf. A016921, A372351 (even and odd bisection), A372290 (numbers occurring in the latter).
Cf. also A302338.

Programs

  • Mathematica
    Array[#2*(2^#3) + ((4^#3) - 1)/3 & @@ {#1, #2, IntegerExponent[#2, 2]} & @@ {#, 3 #1 + 1} &, 67, 0] (* Michael De Vlieger, Apr 19 2024 *)
  • PARI
    A371094(n) = { my(m=1+3*n, e=valuation(m,2)); ((m*(2^e)) + (((4^e)-1)/3)); };
    
  • Python
    def A371094(n): return ((m:=3*n+1)<<(e:=(~m & m-1).bit_length()))+((1<<(e<<1))-1)//3 # Chai Wah Wu, Apr 28 2024

Formula

a(n) = A372289(A016777(n)).
a(2n) = A016777(2n) = A016921(n).

A371100 Array A read by upward antidiagonals in which the entry A(n,k) in row n and column k is defined by A(n, k) = 4^n*(6*k - 3 - 2*(-1)^n) + (4^n - 1)/3, n,k >= 1.

Original entry on oeis.org

21, 21, 45, 341, 117, 69, 341, 725, 213, 93, 5461, 1877, 1109, 309, 117, 5461, 11605, 3413, 1493, 405, 141, 87381, 30037, 17749, 4949, 1877, 501, 165, 87381, 185685, 54613, 23893, 6485, 2261, 597, 189, 1398101, 480597, 283989, 79189, 30037, 8021, 2645, 693, 213, 1398101, 2970965, 873813, 382293, 103765, 36181, 9557, 3029, 789, 237
Offset: 1

Views

Author

Antti Karttunen and Ali Sada, Apr 18 2024

Keywords

Examples

			The top left corner of the array:
n\k|      1       2       3        4        5        6        7        8
---+--------------------------------------------------------------------------
1  |     21,     45,     69,      93,     117,     141,     165,     189, ...
2  |     21,    117,    213,     309,     405,     501,     597,     693, ...
3  |    341,    725,   1109,    1493,    1877,    2261,    2645,    3029, ...
4  |    341,   1877,   3413,    4949,    6485,    8021,    9557,   11093, ...
5  |   5461,  11605,  17749,   23893,   30037,   36181,   42325,   48469, ...
6  |   5461,  30037,  54613,   79189,  103765,  128341,  152917,  177493, ...
7  |  87381, 185685, 283989,  382293,  480597,  578901,  677205,  775509, ...
8  |  87381, 480597, 873813, 1267029, 1660245, 2053461, 2446677, 2839893, ...
...
		

Crossrefs

Cf. A372351 (same terms, in different order), A372290 (sorted into ascending order, without duplicates), A372293 (odd numbers that do not occur here).
Leftmost column is A144864 duplicated, without its initial 1.
Row 1: A102603.

Programs

  • Mathematica
    A371100[n_, k_] := 4^n*(6*k - 3 - 2*(-1)^n) + (4^n - 1)/3;
    Table[A371100[n - k + 1, k], {n, 10}, {k, n}] (* Paolo Xausa, Apr 21 2024 *)
  • PARI
    up_to = 55;
    A371100sq(n,k) = 4^n*(6*k - 3 - 2*(-1)^n) + (4^n - 1)/3;
    A371100list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A371100sq((a-(col-1)),col))); (v); };
    v371100 = A371100list(up_to);
    A371100(n) = v371100[n];

Formula

A(n, k) = A007283(n)*A257852(n,k) + A079319(n).
A(n, k) = A371094(A257852(n,k)).
A(n+2, k) = 5 + 16*A(n,k).

A372351 Odd bisection of A371094.

Original entry on oeis.org

21, 21, 341, 45, 117, 69, 341, 93, 213, 117, 5461, 141, 309, 165, 725, 189, 405, 213, 1877, 237, 501, 261, 1109, 285, 597, 309, 5461, 333, 693, 357, 1493, 381, 789, 405, 3413, 429, 885, 453, 1877, 477, 981, 501, 87381, 525, 1077, 549, 2261, 573, 1173, 597, 4949, 621, 1269, 645, 2645, 669, 1365, 693, 11605, 717
Offset: 1

Views

Author

Antti Karttunen, Apr 28 2024

Keywords

Crossrefs

Row 2 of A372282.
Cf. A371094, and array A371100 (gives the same terms, in different order).
Cf. A372290 (the range of this sequence), A372291 (numbers that occur only once), A372292 (more than once), A372293 (odd numbers not occurring here).

Programs

  • Mathematica
    Table[With[{e = IntegerExponent[6*n - 2, 2]}, (6*n - 2)*2^e + (4^e - 1)/3], {n, 100}] (* Paolo Xausa, Apr 29 2024 *)
  • PARI
    A371094(n) = { my(m=1+3*n, e=valuation(m,2)); ((m*(2^e)) + (((4^e)-1)/3)); };
    A372351(n) = A371094(n+n-1);
    
  • Python
    def A372351(n): return ((m:=6*n-2)<<(e:=(~m & m-1).bit_length()))+((1<<(e<<1))-1)//3 # Chai Wah Wu, Apr 28 2024

Formula

a(n) = A371094(2*n-1).

A372291 Numbers that occur exactly once in the odd bisection of A371094.

Original entry on oeis.org

45, 69, 93, 141, 165, 189, 237, 261, 285, 333, 357, 381, 429, 453, 477, 525, 549, 573, 621, 645, 669, 717, 725, 741, 765, 813, 837, 861, 909, 933, 957, 1005, 1029, 1053, 1101, 1109, 1125, 1149, 1197, 1221, 1245, 1293, 1317, 1341, 1389, 1413, 1437, 1485, 1493, 1509, 1533, 1581, 1605, 1629, 1677, 1701, 1725, 1773, 1797
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2024

Keywords

Comments

Numbers that occur exactly once in array A371100.

Examples

			45 is present because A371094(k) = 45 for no other odd number than k=7.
		

Crossrefs

Setwise difference A372290 \ A372292.

Programs

  • PARI
    A371094(n) = { my(m=1+3*n, e=valuation(m,2)); ((m*(2^e)) + (((4^e)-1)/3)); };
    isA372291(n) = if(!(n%2),0,my(c=0); forstep(k=1,n,2,if(A371094(k)==n,c++;if(c>1,return(0)))); (c));

A372292 Numbers that occur more than once in the odd bisection of A371094.

Original entry on oeis.org

21, 117, 213, 309, 341, 405, 501, 597, 693, 789, 885, 981, 1077, 1173, 1269, 1365, 1461, 1557, 1653, 1749, 1845, 1877, 1941, 2037, 2133, 2229, 2325, 2421, 2517, 2613, 2709, 2805, 2901, 2997, 3093, 3189, 3285, 3381, 3413, 3477, 3573, 3669, 3765, 3861, 3957, 4053, 4149, 4245, 4341, 4437, 4533, 4629, 4725, 4821, 4917
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2024

Keywords

Comments

Numbers that occur more than once in array A371100.

Examples

			21 is present because A371094(1) = A371094(3) = 21.
87381 is present because A371094(85) = A371094(213) = A371094(7281) = A371094(14563) = 87381.
185685 is present because A371094(469) = A371094(15473) = A371094(30947) = 185685.
		

Crossrefs

Setwise difference A372290 \ A372291.
Cf. A144864 (subsequence after its initial 1), A371094, A371100.

Programs

  • PARI
    A371094(n) = { my(m=1+3*n, e=valuation(m,2)); ((m*(2^e)) + (((4^e)-1)/3)); };
    isA372292(n) = if(!(n%2),0,my(c=0); forstep(k=1,n,2,if(A371094(k)==n,c++)); (c>1));
    
  • PARI
    search_up_to = 1398101;
    A371094(n) = { my(m=1+3*n, e=valuation(m,2)); ((m*(2^e)) + (((4^e)-1)/3)); };
    A372292list(up_to_n) = { my(v=vector((1+up_to_n)/2), x, lista=List([])); forstep(k=1,up_to_n,2,x=A371094(k); if(x <= up_to_n, v[(x+1)/2]++)); for(i=1,(1+up_to_n)/2,if(v[i]>1, listput(lista,i+i-1))); Vec(lista); };
    v372292 = A372292list(search_up_to);
    A372292(n) = v372292[n];

A372293 Odd numbers that do not occur in the odd bisection of A371094.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 143, 145, 147, 149, 151, 153, 155, 157
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2024

Keywords

Comments

Odd numbers that do not occur in array A371100.

Crossrefs

Setwise difference A005408 \ A372290.
Subsequences: A004767, A017077.

Programs

  • PARI
    A371094(n) = { my(m=1+3*n, e=valuation(m,2)); ((m*(2^e)) + (((4^e)-1)/3)); };
    isA372293(n) = if(!(n%2),0,forstep(k=1,n,2,if(A371094(k)==n,return(0))); (1));
Showing 1-6 of 6 results.