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

A253786 a(3n) = 0, a(3n+1) = 0, a(3n+2) = 1 + a(n+1).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 22 2015

Keywords

Comments

For n >= 1, a(n) gives the distance of n in square array A191450 from its leftmost column.
The sequence 0,1,0,0,0,2,0,...,i.e., (a(n)) with the first term removed, is the unique fixed point of the constant length 3 morphism N -> 0 N+1 0 on the infinite alphabet {0,1,...,N,...}. - Michel Dekking, Sep 09 2022
a(n) is the number of trailing 1 digits of n-1 written in ternary, for n>=1. - Kevin Ryde, Sep 09 2022

Crossrefs

Programs

  • Mathematica
    With[{nmax=200},IntegerExponent[2Range[0,nmax]-1,3]] (* Paolo Xausa, Nov 09 2023 *)
  • PARI
    a(n) = n--; my(ret=0,r); while([n,r]=divrem(n,3); r==1, ret++); ret; \\ Kevin Ryde, Sep 13 2022

Formula

Other identities and observations. For all n >= 1:
a(n) = A254046(n)-1.
a(n) <= A254045(n) <= A253894(n).
a(3n-1) = A254046(n). - Cyril Damamme, Aug 04 2015
a(n) = A007949(2n-1), i.e., the 3-adic valuation of 2n-1. - Cyril Damamme, Aug 04 2015
From Antti Karttunen, Sep 12 2017: (Start)
For all n >= 1:
a(n) = A007814(A064216(n)) = A007814(A254104(n)) = A135523(A245611(n)).
a(A048673(n)) = a(A254103(n)) = A007814(n).
a(A244154(n)) = A007814(1+n).
a(A245612(n)) = A135523(n). (End)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/2. - Amiram Eldar, Nov 16 2023

A292592 a(n) = A292590(A245612(n)).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 2, 2, 0, 1, 0, 0, 4, 5, 4, 5, 0, 0, 2, 2, 0, 1, 0, 0, 8, 8, 10, 11, 8, 8, 10, 10, 0, 1, 0, 0, 4, 5, 4, 5, 0, 0, 2, 2, 0, 1, 0, 0, 16, 17, 16, 17, 20, 20, 22, 23, 16, 17, 16, 16, 20, 21, 20, 21, 0, 0, 2, 2, 0, 1, 0, 0, 8, 8, 10, 11, 8, 8, 10, 10, 0, 1, 0, 0, 4, 5, 4, 5, 0, 0, 2, 2, 0, 1, 0, 0, 32, 32, 34, 35, 32, 32, 34, 34, 40, 41, 40, 41
Offset: 0

Views

Author

Antti Karttunen, Sep 20 2017

Keywords

Comments

Because A292590(n) = a(A245611(n)), the sequence works as a "masking function" where the 1-bits in a(n) (always a subset of the 1-bits in binary expansion of n) indicate which numbers are multiples of 3 in binary tree A245612 on that trajectory which leads from the root of the tree to the node containing A245612(n). See the examples.

Examples

			A245612(18) = 188, that is, at "node address" 18 in binary tree A245612 sits number 188. 18 in binary is "10010", which when read from left to right (after the most significant bit which is always 1) gives the directions to follow in the tree when starting from the root, to land in node containing number 188. Here, after 1 and 2, turn left from 2, turn left from 5, turn right from 14 and then turn left from 63 and then indeed one lands in 188. These turns correspond with the four lowermost bits of the code, "0010". When one selects multiples of 3 from this path 1 -> 2 -> 5 -> 14 -> 63 -> 188, the only one is 63, which corresponds with the second rightmost bit (which also is the only 1-bit) in the code, which can be masked with 2 (binary "10"), thus a(18) = 2.
A245612(15) = 6, that is, at "node address" 15 in binary tree A245612 sits number 6. 15 in binary is "1111", which tells that 6 can be located in tree A245612 by going (after the initial root 1 and 2) three steps towards right from 2: 1 -> 2 -> 3 -> 4 -> 6. Of these numbers, only 3 and 6 are multiples of 3, thus the mask to obtain the corresponding bits from "1111" is "00101" (5 in binary), thus a(15) = 5.
A245612(31) = 7, that is, at "node address" 31 in binary tree A245612 sits number 7. 31 in binary is "11111", which tells that 7 can be located in tree A245612 by going (after the initial root 1 and 2) four steps towards right from 2: 1 -> 2 -> 3 -> 4 -> 6 -> 7. Of these numbers, only 3 and 6 are multiples of 3, thus the mask to obtain the corresponding bits from "11111" is "001010" (ten in binary), thus a(31) = 10.
		

Crossrefs

Cf. also A292377.
Differs from related A292274 for the first time at n=31, where a(31) = 10, while A292274(31) = 11. Compare also the scatter plots.

Programs

  • Mathematica
    f[n_] := f[n] = Which[n == 1, 0, Mod[n, 3] == 2, Ceiling[n/3], True, (Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1] + 1)/2]; g[n_] := g[n] = If[n == 1, 0, 2 g[f@ n] + Boole[Divisible[n, 3]]]; h[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@If[n == 0, 1, Prime[#] Product[ Prime[m]^(Map[ Ceiling[(Length@ # - 1)/2] &, DeleteCases[ Split@ Join[ Riffle[ IntegerDigits[n, 2], 0], {0}], {k__} /;k == 1]][[-m]]), {m, #}] &[DigitCount[n, 2, 1]]]; Array[g@ h@ # &, 108, 0] (* Michael De Vlieger, Sep 22 2017 *)

Formula

a(n) + A292593(n) = n, a(n) AND A292593(n) = 0.
a(n) AND n = a(n), where AND is bitwise-AND (A004198).

A285714 a(1) = 0; for n > 1, a(n) = 1 + a(A285712(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 25 2017

Keywords

Crossrefs

Programs

Formula

a(1) = 0; for n > 1, a(n) = 1 + a(A285712(n)).
a(n) = A029837(1+A245611(n)).
a(n) = A285715(n) + A285716(n).

A364297 a(n) = A348717(A163511(n)).

Original entry on oeis.org

1, 2, 4, 2, 8, 4, 6, 2, 16, 8, 18, 4, 12, 6, 10, 2, 32, 16, 54, 8, 36, 18, 50, 4, 24, 12, 30, 6, 20, 10, 14, 2, 64, 32, 162, 16, 108, 54, 250, 8, 72, 36, 150, 18, 100, 50, 98, 4, 48, 24, 90, 12, 60, 30, 70, 6, 40, 20, 42, 10, 28, 14, 22, 2, 128, 64, 486, 32, 324, 162, 1250, 16, 216, 108, 750, 54, 500, 250, 686, 8, 144
Offset: 0

Views

Author

Antti Karttunen, Aug 15 2023

Keywords

Comments

For all i, j: a(i) = a(j) => A278531(i) = A278531(j).
As the underlying sequence A163511 can be represented as a binary tree, so can this be also:
1
|
...................2...................
4 2
8......../ \........4 6......../ \........2
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
16 8 18 4 12 6 10 2
32 16 54 8 36 18 50 4 24 12 30 6 20 10 14 2
etc.
Each rightward leaning branch stays constant, because a(2n+1) = a(n).
Conjecture: Mersenne primes (A000668) gives all such odd numbers k for which a(k) = A348717(k). If true, then it immediately implies that map n -> A163511(n) [or equally: map n -> A243071(n)] has no other fixed points than those given by A007283. But see also A364959. - Edited Sep 03 2023

Crossrefs

Programs

  • PARI
    A163511(n) = if(!n,1,my(p=2, t=1); while(n>1, if(!(n%2), (t*=p), p=nextprime(1+p)); n >>= 1); (t*p));
    A348717(n) = if(1==n, 1, my(f = factor(n), k = primepi(f[1, 1])-1); for (i=1, #f~, f[i, 1] = prime(primepi(f[i, 1])-k)); factorback(f));
    A364297(n) = A348717(A163511(n));

Formula

a(0) = 1, a(1) = 2, a(2n) = A163511(2n) = 2*A163511(n), and for n > 0, a(2n+1) = a(n).

A292590 a(1) = 0; and for n > 1, a(n) = 2*a(A285712(n)) + [0 == (n mod 3)].

Original entry on oeis.org

0, 0, 1, 2, 0, 5, 10, 2, 21, 42, 4, 85, 0, 0, 171, 342, 10, 5, 684, 20, 1369, 2738, 4, 5477, 0, 42, 10955, 8, 84, 21911, 43822, 8, 21, 87644, 170, 175289, 350578, 0, 11, 701156, 0, 1402313, 40, 342, 2804627, 16, 684, 85, 5609254, 20, 11218509, 22437018, 10, 44874037, 89748074, 1368, 179496149, 168, 40, 43, 0, 2738, 1, 358992298, 5476, 717984597, 80, 8
Offset: 1

Views

Author

Antti Karttunen, Sep 20 2017

Keywords

Comments

Binary expansion of a(n) encodes the positions of multiples of three in the path taken from n to the root in the binary trees like A245612 and A244154.

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = Which[n == 1, 0, Mod[n, 3] == 2, Ceiling[n/3], True, (Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1] + 1)/2]; a[n_] := a[n] = If[n == 1, n - 1, 2 a[f@ n] + Boole[Divisible[n, 3]]]; Array[a, 67] (* Michael De Vlieger, Sep 22 2017 *)
  • Scheme
    (define (A292590 n) (if (<= n 1) 0 (+ (if (zero? (modulo n 3)) 1 0) (* 2 (A292590 (A285712 n))))))

Formula

a(1) = 0; and for n > 1, a(n) = A079978(n) + 2*a(A285712(n)).
a(n) + A292591(n) = A245611(n).
a(A245612(n)) = A292592(n).
A000120(a(n)) = A292594(n).

A292591 a(1) = 0, a(2) = 1; and for n > 2, a(n) = 2*a(A285712(n)) + [1 == (n mod 3)].

Original entry on oeis.org

0, 1, 2, 5, 2, 10, 21, 4, 42, 85, 10, 170, 5, 4, 340, 681, 20, 8, 1363, 42, 2726, 5453, 8, 10906, 11, 84, 21812, 21, 170, 43624, 87249, 20, 40, 174499, 340, 348998, 697997, 10, 16, 1395995, 8, 2791990, 85, 680, 5583980, 43, 1362, 168, 11167961, 40, 22335922, 44671845, 16, 89343690, 178687381, 2726, 357374762, 341, 84, 80, 23, 5452, 8, 714749525, 10906
Offset: 1

Views

Author

Antti Karttunen, Sep 20 2017

Keywords

Comments

Binary expansion of a(n) encodes the positions of numbers of the form 3k+1 (with k >= 1) in the path taken from n to the root in the binary trees A245612 and A244154, except that the most significant 1-bit of a(n) always corresponds to 2 instead of 1 at the root of those trees.

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = Which[n == 1, 0, Mod[n, 3] == 2, Ceiling[n/3], True, (Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1] + 1)/2]; a[n_] := a[n] = If[n <= 2, n - 1, 2 a[f@ n] + Boole[Mod[n, 3] == 1]]; Array[a, 65] (* Michael De Vlieger, Sep 22 2017 *)
  • Scheme
    (define (A292591 n) (if (<= n 2) (- n 1) (+ (if (= 1 (modulo n 3)) 1 0) (* 2 (A292591 (A285712 n))))))

Formula

a(n) + A292590(n) = A245611(n).
a(A245612(n)) = A292593(n).
A000120(a(n)) = A292595(n).

A275715 Permutation of natural numbers: a(n) = A243071(A249823(n)).

Original entry on oeis.org

0, 1, 3, 7, 15, 31, 63, 127, 2, 255, 511, 6, 1023, 2047, 4095, 8191, 5, 16383, 14, 32767, 65535, 30, 131071, 262143, 524287, 13, 1048575, 2097151, 62, 4194303, 29, 126, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 254, 61, 11, 4, 536870911, 1073741823, 125, 2147483647, 4294967295, 27, 510, 8589934591
Offset: 1

Views

Author

Antti Karttunen, Aug 06 2016

Keywords

Comments

Note the indexing: the domain starts from 1, while the range includes also zero.

Crossrefs

Inverse: A275716.
Related or similar permutations: A243071, A249823, A245611.
Cf. also A273664, A273669.

Programs

Formula

a(n) = A243071(A249823(n)).
Previous Showing 11-17 of 17 results.