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.

A116640 a(n) = A116623(A059893(n)).

Original entry on oeis.org

1, 5, 7, 19, 11, 23, 29, 65, 19, 31, 37, 73, 49, 85, 103, 211, 35, 47, 53, 89, 65, 101, 119, 227, 89, 125, 143, 251, 179, 287, 341, 665, 67, 79, 85, 121, 97, 133, 151, 259, 121, 157, 175, 283, 211, 319, 373, 697, 169, 205, 223, 331, 259, 367, 421, 745, 331
Offset: 0

Views

Author

Antti Karttunen, Feb 20 2006. Proposed by Pierre Lamothe (plamothe(AT)aei.ca), May 21 2004

Keywords

Comments

Viewed as a binary tree, this is (1); 5; 7,19; 11,23,29,65; ... Cf. A116623.
If we treat (2n+1) as a binary number with the nonzero bits numbered (highest bit first) from 0..k and the regular binary place value of each nonzero bit numbered from b(0) to b(k) then a(n) = 3^0 * b(0) + 3^1 * b(1) + .. + 3^k. For instance, if n=6 then 2n+1 = 13, which is equal to 8+4+1 or 1101 base(2); and a(n)=29 which is 8*1 + 4*3 + 1*9. - Joe Slater, Jan 23 2016

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; piecewise(
        n mod 4 = 0, 3*procname(n/2) - 2*procname(n/4),
      n mod 4 = 1, 6*procname((n-1)/4) - procname((n-1)/2),
      n mod 4 = 2, procname(n/2) + 2*procname((n-2)/4),
      5*procname((n-1)/2) - 6*procname((n-3)/4))
    end proc:
    a(0):= 1:
    map(a, [$0..100]); # Robert Israel, Jan 19 2016
  • Mathematica
    a[n_] := a[n] = Switch[Mod[n, 4], 0, 3a[Floor[n/2]] - 2a[Floor[n/4]], 1, 6a[Floor[n/4]] - a[Floor[n/2]], 2, a[Floor[n/2]] + 2a[Floor[n/4]], 3, 5a[Floor[n/2]] - 6a[Floor[n/4]]]; a[0]=1; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 28 2016 *)
  • PARI
    a(n) = if(n==0, return(1)); 2*a(n\2) - (-1)^n * 3^hammingweight(n) \\ Charles R Greathouse IV, Jan 21 2016
    
  • PARI
    a(n) = my(p=2*n+1,v=vecextract(vector(#binary(p),j,2^(j-1)),p));sum(i=0,#v-1,3^i*v[#v-i]) \\ Joe Slater, May 09 2017

Formula

a(A000225(n)) = A001047(n+1).
For n>= 1 a(A000079(n)) = A062709(n+1).
From Joe Slater, Jan 19 2016: (Start)
a(0) = 1,
a(n) = 3*a(floor(n/2)) - 2*a(floor(n/4)) for n=0 (mod 4) and n>0,
a(n) = 6*a(floor(n/4)) - a(floor(n/2)) for n=1 (mod 4),
a(n) = a(floor(n/2)) + 2*a(floor(n/4)) for n=2 (mod 4),
a(n) = 5*a(floor(n/2)) - 6*a(floor(n/4)) for n=3 (mod 4)
(End)
a(0) = 1, a(n) = 2*a(floor(n/2)) - A033999(n) * A048883(n) for n>0. -
Joe Slater, Jan 22 2016

A116641 A116623 sorted, without duplicates.

Original entry on oeis.org

1, 5, 7, 11, 19, 23, 29, 31, 35, 37, 47, 49, 53, 65, 67, 73, 79, 85, 89, 97, 101, 103, 119, 121, 125, 131, 133, 143, 149, 151, 157, 161, 169, 175, 179, 185, 197, 205, 211, 215, 221, 223, 227, 233, 239, 251, 259, 269, 271, 275, 277, 283, 287, 289, 313, 319, 323
Offset: 0

Views

Author

Antti Karttunen, Feb 20 2006. Proposed by Pierre Lamothe (plamothe(AT)aei.ca), May 21 2004

Keywords

Comments

Related to the parity vectors of Terras and Collatz trajectories.
From Bob Selcoe, Sep 14 2019: (Start)
Let R_s be the reduced Collatz sequence starting with s and let R_s(i), i >= 0 be the i-th term in R_s. Then any term in R_s can be described as (3*s^i + k)/2^j, where j is the total number of halving steps from R_s(0) to R_s(i) i >= 1, and k is some term in A116641. k=1 when i=1; when i > 1, k is determined by the specific order of halving steps in R_s.
Ignoring duplicates, terms in A116641 > 1 can be generated by a series of subsequences:
1. Start with subsequence a(m) = 3+2^m, m >= 1; i.e., a(m) = {5,7,11,19,35,67,...}.
2. For fixed m, generate new subsequences b(n) = 3*a(m) + 2^(m+n), n >= 1; so:
m=1, a(1)=5, b(n) = 3*5 + {4,8,16,32,...} = {19,23,31,47,...};
m=2, a(2)=7, b(n) = 3*7 + {8,16,32,64,...} = {29,37,53,85,...};
m=3, a(3)=11, b(n) = 3*11 + {16,32,64,128,...} = {49,65,97,161,...}; etc.
3. Let 2^y be the summand used to find terms (t) in any previously-generated subsequence. (For instance, in m=2, b(3)=53: y=5 because t=53 = 3*7 + 32.) Continue generating new subsequences p(q) = 3*t + 2^(y+z) {z=1..inf} for all t. So in this example, from t=53 we get p(q) = 3*53 + {64,128,256,512,...} = {223,287,415,671,...}; from t=671 we get p(q) = 3*671 + {1024,2048,4096,...} = {3037,4061,6109,...}, etc. (End)

Crossrefs

Cf. A116642 gives the same sequence in binary.

A274048 a(n) = A116640(A018900(n)) = A116623(A059893(A018900(n))).

Original entry on oeis.org

19, 23, 29, 31, 37, 49, 47, 53, 65, 89, 79, 85, 97, 121, 169, 143, 149, 161, 185, 233, 329, 271, 277, 289, 313, 361, 457, 649, 527, 533, 545, 569, 617, 713, 905, 1289, 1039, 1045, 1057, 1081, 1129, 1225, 1417, 1801
Offset: 1

Views

Author

Joe Slater, Jun 07 2016

Keywords

Comments

A subset of A116640 containing all terms A116640(m) such that m has binary weight of 2. This sequence is related to the Collatz and Terras trajectories; specifically those trajectories that include three odd numbers besides 1.

Examples

			The first three terms of A018900 are 3,5,6. Taking these terms from A116640 gives 19,23,29, which are the first three terms of this sequence. The sequence is generated from the regular triangle
1;
1,2;
1,2,3;
etc., so the first three terms are
2^(1+1) + 3*(3+2^1) = 19;
2^(2+1) + 3*(3+2^1) = 23;
2^(2+1) + 3*(3+2^2)= 29.
		

Crossrefs

Subsequence of A116640.
Cf. A116623.

Formula

a(n) = 2^(Row(n)+1) + 3*(3+2^Col(n)) where Row(n) = A002024(n) = the row position of n when the sequence is viewed as a regular triangle; and Col(n) = A002260(n) = the column position of n when the sequence is viewed as a regular triangle.

A119733 Offsets of the terms of the nodes of the reverse Collatz function.

Original entry on oeis.org

0, 1, 2, 5, 4, 7, 10, 19, 8, 11, 14, 23, 20, 29, 38, 65, 16, 19, 22, 31, 28, 37, 46, 73, 40, 49, 58, 85, 76, 103, 130, 211, 32, 35, 38, 47, 44, 53, 62, 89, 56, 65, 74, 101, 92, 119, 146, 227, 80, 89, 98, 125, 116, 143, 170, 251, 152, 179, 206, 287, 260, 341, 422, 665, 64, 67
Offset: 0

Views

Author

William Entriken, Jun 14 2006

Keywords

Comments

Create a binary tree starting with x. To follow 0 from the root, apply f(x)=2x. To follow 1, apply g(x)=(2x-1)/3. For example, starting with x, the string 010 {also known as f(g(f(x)))}, you would get (8x-2)/3. These expressions represent the reverse Collatz function and will provide numbers whose Collatz path may include x. These expressions will all be of the form (2^a*x-b)/3^c. This sequence concerns b. What makes b interesting is that if you draw the tree, each level of the tree will have the same sequence of values for b. The root of the tree x, can be written as (2^0*x-0)/3^0, which has the first value for b. Each subsequent level contains twice as many values of b.
This sequence is 0 followed by a permutation of A213539, and therefore consists of 0 plus the elements of A116640 multiplied by 2^k, where k >= 0. E.g., 1, 5, 7, 19 becomes 0, 2^0*1, 2^1*1, 2^0*5, 2^2*1, 2^0*7, 2^1*5, 2^0*19, ... - Joe Slater, Dec 19 2016
When this sequence is arranged as an irregular triangle the sum of each row a(2^k)...a(2^(k+1)-1) equals A081039(2^k). The cumulative sum from a(0) to a(2^k-1) equals A002697(k). - Joe Slater, Apr 12 2018

Examples

			a(1) = 1 = 2 * 0 + 3^0 since 0 written in binary contains no 1's.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) `if`(n=0, 0, `if`(irem(n, 2, 'r')=0, 0,
          3^add(i, i=convert(r, base, 2)))+2*a(r))
        end:
    seq(a(n), n=0..127);  # Alois P. Heinz, Aug 13 2017
  • Mathematica
    a[0] := 0; a[n_?OddQ] := 2a[(n - 1)/2] + 3^Plus@@IntegerDigits[(n - 1)/2, 2]; a[n_?EvenQ] := 2a[n/2]; Table[a[n], {n, 0, 65}] (* Alonso del Arte, Apr 21 2011 *)
  • PARI
    a(n) = my(ret=0); if(n, for(i=0,logint(n,2), if(bittest(n,i), ret=3*ret+1<Kevin Ryde, Oct 22 2021
  • Perl
    # call with n to get 2^n values
    $depth=shift; sub funct { my ($i, $b, $c) = @_; if ($i < $depth) { funct($i+1, $b*2, $c); funct($i+1, 2*$b+$c, $c*3); } else { print "$b, "; } } funct(0, 0, 1); print " ";
    
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def a(n): return 0 if n==0 else 2*a((n - 1)//2) + 3**bin((n - 1)//2).count('1') if n%2 else 2*a(n//2)
    print([a(n) for n in range(131)]) # Indranil Ghosh, Aug 13 2017
    

Formula

a(0) = 0, a(2*n + 1) = 2*a(n) + 3^wt(n) = 2*a(n) + A048883(n), a(2*n) = 2*a(n), where wt(n) = A000120(n) = the number 1's in the binary representation of n.
a(k) = [z^k] 1 + (1/(1-z)) * Sum_{s=0..n-1} 2^s*z^(2^s)*(1 - z^(2^s)) * Product_{r=s+1..n-1} (1 + 3*z^(2^r)), for 0 < k <= 2^n-1. - Wolfgang Hintze, Jul 28 2017
a(n) = Sum_{i=0..k} 2^e[i] * 3^i where binary expansion n = 2^e[0] + 2^e[1] + ... + 2^e[k] with descending e[0] > e[1] > ... > e[k] (A272011). [Martín Chabrera lemma 6.1, adapting index i] - Kevin Ryde, Oct 22 2021

A213539 Variant of numbers for which there is at least one 3-smooth representation that is special of level k.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 11, 14, 16, 19, 20, 22, 23, 28, 29, 31, 32, 35, 37, 38, 40, 44, 46, 47, 49, 53, 56, 58, 62, 64, 65, 67, 70, 73, 74, 76, 79, 80, 85, 88, 89, 92, 94, 97, 98, 101, 103, 106, 112, 116, 119, 121, 124, 125, 128, 130, 131, 133, 134, 140, 143, 146
Offset: 0

Views

Author

Kenneth Vollmar, Mar 03 2013

Keywords

Comments

These numbers are of the form 3^k*2^{a_0} + 3^{k-1}*2^{a_1} + ... + 3^1*2^{a_{k-1}} + 3^0*2^{a_k} in which every power 3^i appears, 0 <= i <= k, and where a_i satisfies 0 <= a_0 < a_1 < ... < a_k.
These values are those of sequence A116640 in addition to any multiple of two of elements of this sequence. - Kenneth Vollmar, Jun 05 2013

Examples

			n=19 has two 3-smooth representations that are special of level k. At k=1, 19 = 3^1*2^0 + 3^0*2^4. At k=2, 19 = 3^2*2^0 + 3^1*2^1 + 3^0*2^2.
		

References

  • Kenneth Vollmar, Recursive calculation of 3-smooth representations special of level k, To be submitted mid-2013.

Crossrefs

Extensions

Corrected a reference to another sequence and added cross references - Joe Slater, Dec 19 2016

A327283 Irregular triangle T(n,k) read by rows: "residual summands" in reduced Collatz sequences (see Comments for definition and explanation).

Original entry on oeis.org

1, 1, 5, 1, 5, 19, 73, 347, 1, 7, 29, 103, 373, 1631, 1, 5, 23, 133, 1, 11, 1, 5, 19, 65, 451, 1, 7, 53, 1, 5, 31, 125, 503, 2533, 1, 1, 5, 19, 185, 1, 7, 29, 151, 581, 2255, 10861, 1, 5, 23, 85, 287, 925
Offset: 1

Views

Author

Bob Selcoe, Sep 15 2019

Keywords

Comments

Let R_s be the reduced Collatz sequence (cf. A259663) starting with s and let R_s(k), k >= 0 be the k-th term in R_s. Then R_(2n-1)(k) = (3^k*(2n-1) + T(n,k))/2^j, where j is the total number of halving steps from R_(2n-1)(0) to R_(2n-1)(k). T(n,k) is defined here as the "residual summand".
The sequence without duplicates is a permutation of A116641.

Examples

			Triangle starts:
  1;
  1, 5;
  1;
  1, 5, 19, 73,  347;
  1, 7, 29, 103, 373, 1631;
  1, 5, 23, 133;
  1, 11;
  1, 5, 19, 65,  451;
  1, 7, 53;
  1, 5, 31, 125, 503, 2533;
  1;
  1, 5, 19, 185;
  1, 7, 29, 151, 581, 2255, 10861;
  ...
T(5,4)=103 because R_9(4) = 13; the number of halving steps from R_9(0) to R_9(4) is 6, and 13 = (81*9 + 103)/64.
		

Crossrefs

Formula

T(n,k) = 2^j*R_(2n-1)(k) - 3^k*(2n-1), as defined in Comments.
T(n,1) = 1; for k>1: T(n,k) = 3*T(n,k-1) + 2^i, where i is the total number of halving steps from R_(2n-1)(0) to R_(2n-1)(k-1).
Showing 1-6 of 6 results.