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-10 of 11 results. Next

A292383 Base-2 expansion of a(n) encodes the steps where numbers of the form 4k+3 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 5, 0, 0, 4, 11, 4, 22, 10, 5, 0, 44, 0, 89, 8, 8, 22, 179, 8, 0, 44, 1, 20, 358, 10, 717, 0, 20, 88, 11, 0, 1434, 178, 45, 16, 2868, 16, 5737, 44, 8, 358, 11475, 16, 0, 0, 89, 88, 22950, 2, 17, 40, 176, 716, 45901, 20, 91802, 1434, 17, 0, 40, 40, 183605, 176, 356, 22, 367211, 0, 734422, 2868, 1, 356, 22, 90, 1468845, 32, 0, 5736, 2937691, 32
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			For n = 3, the starting value is of the form 4k+3, after which follows A252463(3) = 2, and A252463(2) = 1, the end point of iteration, and neither 2 nor 1 is of the form 4k+3, thus a(3) = 1*(2^0) + 0*(2^1) + 0*(2^2) = 1.
For n = 5, the starting value is not of the form 4k+3, after which follows A252463(5) = 3 (which is), continuing as before as 3 -> 2 -> 1, thus a(5) = 0*(2^0) + 1*(2^1) + 0*(2^2) + 0*(2^3) = 2.
For n = 10, the starting value is not of the form 4k+3, after which follows A252463(10) = 5 (also not 4k+3), and then A252463(5) = 3 (which is), continuing as before as 3 -> 2 -> 1, thus a(10) = 0*(2^0) + + 0*(2^1) + 1*(2^2) + 0*(2^3) + 0*(2^4) = 4.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Reverse@ NestWhileList[Function[k, Which[k == 1, 1, EvenQ@ k, k/2, True, Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ k]], n, # > 1 &] /. k_ /; IntegerQ@ k :> If[Mod[k, 4] == 3, 1, 0], 2], {n, 84}] (* Michael De Vlieger, Sep 21 2017 *)
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A252463(n) = if(!(n%2),n/2,A064989(n));
    A292383(n) = if(1==n,0,(if(3==(n%4),1,0)+(2*A292383(A252463(n)))));
    
  • Scheme
    (define (A292383 n) (A292373 (A292384 n)))

Formula

a(1) = 0; for n > 1, a(n) = 2*a(A252463(n)) + [n ≡ 3 (mod 4)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 4k+3, and 0 otherwise.
a(n) = A292373(A292384(n)).
a(n) = A292274(A243071(n)).
Other identities. For n >= 1:
a(2n) = 2*a(n).
a(n) + A292385(n) = A243071(n).
a(A163511(n)) = A292274(n).
A000120(a(n)) = A292377(n).

A292385 a(1) = 0, a(2) = 1, and for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 4)].

Original entry on oeis.org

0, 1, 2, 2, 5, 4, 10, 4, 5, 10, 20, 8, 41, 20, 8, 8, 83, 10, 166, 20, 21, 40, 332, 16, 11, 82, 8, 40, 665, 16, 1330, 16, 41, 166, 16, 20, 2661, 332, 80, 40, 5323, 42, 10646, 80, 17, 664, 21292, 32, 23, 22, 164, 164, 42585, 16, 42, 80, 333, 1330, 85170, 32, 170341, 2660, 40, 32, 83, 82, 340682, 332, 665, 32, 681364, 40, 1362729, 5322, 20, 664, 33, 160
Offset: 1

Views

Author

Antti Karttunen, Sep 16 2017

Keywords

Comments

Variant of A292381. Here the most significant 1-bit is at the one step smaller position.

Crossrefs

Formula

a(1) = 0, a(2) = 1, and for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 4)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 4k+1, and 0 otherwise.
For n >= 1, a(n) + A292383(n) = A243071(n); a(A163511(n)) = A292271(n).
For n >= 2, A004754(a(n)) = A292381(n).

A292375 a(1) = 1, and for n > 1, a(n) = a(A252463(n)) + [n == 1 (mod 4)].

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 17 2017

Keywords

Comments

For numbers > 1, iterate the map x -> A252463(x) which divides even numbers by 2, and shifts every prime in the prime factorization of odd n one index step towards smaller primes. a(n) counts the numbers of the form 4k+1 encountered until 1 has been reached, which is also included in the count. The count includes also n itself if it is of the form 4k+1 (A016813), thus a(1) = 1.
In other words, locate the node which contains n in binary tree A005940 and traverse from that node towards the root, counting all numbers of the form 4k+1 that occur on the path.

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = a[Which[n == 1, 1, EvenQ@n, n/2, True, Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n]] + Boole[Mod[n, 4] == 1]; Array[a, 105] (* Michael De Vlieger, Sep 17 2017 *)
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A292375(n) = if(1==n,n,if(!(n%2),A292375(n/2),(if(1==(n%4),1,0)+A292375(A064989(n)))));
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A292375 n) (if (= 1 n) 1 (+ (if (= 1 (modulo n 4)) 1 0) (A292375 (A252463 n)))))

Formula

a(1) = 1, a(2n) = a(n), and for odd numbers n > 1, a(n) = a(A064989(n)) + [n == 1 (mod 4)].
a(n) = A000120(A292381(n)).
Other identities and observations. For n >= 1:
a(n) >= A292374(n).
a(A000040(n))-1 = A267097(n).
1 + A292377(n) - a(n) = A292378(n).
For n >= 2, a(n) + A292377(n) = A061395(n).
From Antti Karttunen, Apr 22 2022: (Start)
For n >= 2, a(n^2) = A061395(n). [Because A292377(n^2) = 0]
For n >= 1, a(A001248(n)) = n. [See comments in A292583]
(End)

A292244 Base-2 expansion of a(n) encodes the steps where multiples of 3 are encountered when map x -> A253889(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 0, 1, 0, 0, 3, 0, 2, 5, 0, 0, 1, 0, 0, 1, 12, 6, 7, 14, 0, 1, 0, 4, 1, 8, 10, 3, 0, 0, 21, 24, 0, 1, 28, 2, 3, 2, 0, 1, 0, 0, 5, 2, 2, 1, 22, 24, 17, 0, 12, 33, 32, 14, 35, 42, 28, 45, 24, 0, 1, 16, 2, 11, 48, 0, 59, 0, 8, 3, 0, 2, 5, 0, 16, 1, 4, 20, 3, 6, 6, 7, 8, 0, 1, 56, 0, 3, 0, 42, 5, 0, 48, 5, 0, 0, 1, 14, 2, 65, 64, 56, 49, 44, 4, 49, 64, 6, 57, 0
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			For n = 3, the starting value is a multiple of three, after which follows A253889(3) = 1, the end point of iteration, which is not a multiple of three, thus a(3) = 1*(2^0) = 1.
For n = 8, the starting value is not a multiple of three, after which follows A253889(8) = 3, which is, thus a(8) = 0*(2^0) + 1*(2^1) = 2.
For n = 9, the starting value is a multiple of three, after which follows A253889(9) = 8 (which is not), while A253889(8) = 3 (which is), thus a(9) = 1*(2^0) + 0*(2^1) + 1*(2^2) = 5.
		

Crossrefs

Cf. also A292245, A292246, and A292381, A292383, A292385, and A292590, A292591 for similarly constructed sequences, and also A292250.

Programs

  • Mathematica
    f[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1];g[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n;Table[FromDigits[#, 2] &@ Map[Boole[Divisible[#, 3]] &,  Reverse@ NestWhileList[Floor@ g[Floor[f[#]/2]] &, n, # > 1 &]], {n, 109}] (* Michael De Vlieger, Sep 16 2017 *)
  • Scheme
    (define (A292244 n) (A291770 (A292243 n)))

Formula

a(n) = A291770(A292243(n)).
Other identities. For all n >= 1:
a(A048673(n)) = A292247(n).
a(n) + A292245(n) = A064216(n).
a(n) AND A292245(n) = a(n) AND A292246(n) = 0, where AND is a bitwise-AND (A004198).

A292382 Base-2 expansion of a(n) encodes the steps where numbers of the form 4k+2 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 8, 4, 4, 9, 16, 10, 32, 17, 10, 8, 64, 9, 128, 18, 18, 33, 256, 20, 8, 65, 8, 34, 512, 21, 1024, 16, 34, 129, 20, 18, 2048, 257, 66, 36, 4096, 37, 8192, 66, 20, 513, 16384, 40, 16, 17, 130, 130, 32768, 17, 36, 68, 258, 1025, 65536, 42, 131072, 2049, 36, 32, 68, 69, 262144, 258, 514, 41, 524288, 36, 1048576, 4097, 18, 514, 40
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Reverse@ NestWhileList[Function[k, Which[k == 1, 1, EvenQ@ k, k/2, True, Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ k]], n, # > 1 &] /. k_ /; IntegerQ@ k :> If[Mod[k, 4] == 2, 1, 0], 2], {n, 77}] (* Michael De Vlieger, Sep 21 2017 *)
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A252463(n) = if(!(n%2),n/2,A064989(n));
    A292382(n) = if(1==n,0,(if(2==(n%4),1,0)+(2*A292382(A252463(n)))));
    
  • PARI
    a(n) = my(m=factor(n),k=-2); sum(i=1,matsize(m)[1], 1 << (primepi(m[i,1]) + (k+=m[i,2]))); \\ Kevin Ryde, Dec 11 2020
    
  • Python
    from sympy.core.cache import cacheit
    from sympy.ntheory.factor_ import digits
    from sympy import factorint, prevprime
    from operator import mul
    from functools import reduce
    def a292372(n):
        k=digits(n, 4)[1:]
        return 0 if n==0 else int("".join(['1' if i==2 else '0' for i in k]), 2)
    def a064989(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f])
    def a252463(n): return 1 if n==1 else n//2 if n%2==0 else a064989(n)
    @cacheit
    def a292384(n): return 1 if n==1 else 4*a292384(a252463(n)) + n%4
    def a(n): return a292372(a292384(n))
    print([a(n) for n in range(1, 111)]) # Indranil Ghosh, Sep 21 2017
  • Scheme
    (define (A292382 n) (A292372 (A292384 n)))
    

Formula

a(n) = A292272(A156552(n)).
a(1) = 0; for n > 1, a(n) = 2*a(A252463(n)) + [n == 2 (mod 4)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 4k+2, and 0 otherwise.
a(n) = A292372(A292384(n)).
Other identities. For n >= 1:
a(n) AND A292380(n) = 0, where AND is a bitwise-AND (A004198).
a(n) + A292380(n) = A156552(n).
A000120(a(n)) + A000120(A292380(n)) = A001222(n).

A292941 a(1) = 0, a(2) = 1, and for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 6)].

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 9, 4, 4, 8, 18, 8, 37, 18, 8, 8, 74, 8, 149, 16, 16, 36, 298, 16, 9, 74, 8, 36, 596, 16, 1193, 16, 36, 148, 16, 16, 2387, 298, 72, 32, 4774, 32, 9549, 72, 16, 596, 19098, 32, 19, 18, 148, 148, 38196, 16, 33, 72, 296, 1192, 76392, 32, 152785, 2386, 32, 32, 72, 72, 305571, 296, 596, 32, 611142, 32, 1222285, 4774, 16, 596, 32
Offset: 1

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

Base-2 expansion of a(n) encodes the steps where numbers of the form 6k+1 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n. An exception is the most significant bit of a(n) which corresponds with the final 1, but is shifted one bit-position towards right (less significant end).
The AND - XOR formulas just restate the fact that J(-3|n) = J(-1|n)*J(3|n), as the Jacobi-symbol is multiplicative (also) with respect to its upper argument.

Crossrefs

Programs

  • Scheme
    (define (A292941 n) (if (<= n 2) (- n 1) (+ (if (= 1 (modulo n 6)) 1 0) (* 2 (A292941 (A252463 n))))))

Formula

a(1) = 0, a(2) = 1, and for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 6)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 6k+1, and 0 otherwise.
Also, for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 2)]*[J(-3|n) = 1], where J is the Jacobi-symbol.
a(n) = A292263(n) AND (A292253(n) XOR A292383(n)), where AND is bitwise-and (A004198) and XOR is bitwise-XOR (A003987).
a(n) = A292263(n) AND (A292255(n) XOR A292385(n)). [See comments.]
For n >= 0, a(A163511(n)) = A292942(n).
For n >= 1, a(n) + A292943(n) + A292945(n) = A243071(n).

A292380 Base-2 expansion of a(n) encodes the steps where multiples of 4 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 3, 2, 0, 0, 1, 0, 0, 0, 7, 0, 4, 0, 1, 0, 0, 0, 3, 4, 0, 6, 1, 0, 0, 0, 15, 0, 0, 0, 9, 0, 0, 0, 3, 0, 0, 0, 1, 2, 0, 0, 7, 8, 8, 0, 1, 0, 12, 0, 3, 0, 0, 0, 1, 0, 0, 2, 31, 0, 0, 0, 1, 0, 0, 0, 19, 0, 0, 8, 1, 0, 0, 0, 7, 14, 0, 0, 1, 0, 0, 0, 3, 0, 4, 0, 1, 0, 0, 0, 15, 0, 16, 2, 17, 0, 0, 0, 3, 0
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			For n = 4, the starting value is a multiple of four, after which follows A252463(4) = 2, and A252463(2) = 1, the end point of iteration, and neither 2 nor 1 is a multiple of four, thus a(4) = 1*(2^0) + 0*(2^1) + 0*(2^2) = 1.
For n = 8, the starting value is a multiple of four, after which follows A252463(8) = 4 (also a multiple), continuing as before as 4 -> 2 -> 1, thus a(8) = 1*(2^0) + 1*(2^1) + 0*(2^2) + 0*(2^3) = 3.
For n = 9, the starting value is not a multiple of four, after which follows A252463(9) = 4 (which is), continuing as before as 4 -> 2 -> 1, thus a(9) = 0*(2^0) + 1*(2^1) + 0*(2^2) + 0*(2^3) = 2.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Reverse@ NestWhileList[Function[k, Which[k == 1, 1, EvenQ@ k, k/2, True, Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ k]], n, # > 1 &] /. k_ /; IntegerQ@ k :> If[Mod[k, 4] == 0, 1, 0], 2], {n, 105}] (* Michael De Vlieger, Sep 21 2017 *)
  • PARI
    a(n) = my(m=factor(n),k=-1,ret=0); for(i=1,matsize(m)[1], ret += bitneg(0,m[i,2]-1) << (primepi(m[i,1])+k); k+=m[i,2]); ret; \\ Kevin Ryde, Dec 11 2020
  • Python
    from sympy.core.cache import cacheit
    from sympy.ntheory.factor_ import digits
    from sympy import factorint, prevprime
    from operator import mul
    from functools import reduce
    def a292370(n):
        k=digits(n, 4)[1:]
        return 0 if n==0 else int("".join(['1' if i==0 else '0' for i in k]), 2)
    def a064989(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f])
    def a252463(n): return 1 if n==1 else n//2 if n%2==0 else a064989(n)
    @cacheit
    def a292384(n): return 1 if n==1 else 4*a292384(a252463(n)) + n%4
    def a(n): return a292370(a292384(n))
    print([a(n) for n in range(1, 111)]) # Indranil Ghosh, Sep 21 2017
    
  • Scheme
    (define (A292380 n) (A292370 (A292384 n)))
    

Formula

a(n) = A048735(A156552(n)).
a(n) = A292370(A292384(n)).
Other identities. For n >= 1:
a(n) AND A292382(n) = 0, where AND is a bitwise-AND (A004198).
a(n) + A292382(n) = A156552(n).
A000120(a(n)) + A000120(A292382(n)) = A001222(n).
A000035(a(n)) = A121262(n).

A292384 a(1) = 1; for n > 1, a(n) = 4*a(A252463(n)) + (n mod 4).

Original entry on oeis.org

1, 6, 27, 24, 109, 110, 439, 96, 97, 438, 1759, 440, 7037, 1758, 443, 384, 28149, 390, 112599, 1752, 1753, 7038, 450399, 1760, 389, 28150, 387, 7032, 1801597, 1774, 7206391, 1536, 7033, 112598, 1775, 1560, 28825565, 450398, 28155, 7008, 115302261, 7014, 461209047, 28152, 1761, 1801598, 1844836191, 7040, 1557, 1558, 112603, 112600
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Comments

a(n) encodes in its base-4 representation the succession of modulo 4 residues obtained when map x -> A252463(x), starting from x=n, is iterated down to the eventual 1.

Crossrefs

Programs

  • Python
    from sympy.core.cache import cacheit
    from sympy import factorint, prevprime, prod
    def a064989(n):
        f = factorint(n)
        return 1 if n == 1 else prod(prevprime(i)**f[i] for i in f if i != 2)
    def a252463(n): return 1 if n==1 else n//2 if n%2==0 else a064989(n)
    @cacheit
    def a(n): return 1 if n==1 else 4*a(a252463(n)) + n%4
    print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Sep 21 2017

Formula

a(1) = 1; for n > 1, a(n) = 4*a(A252463(n)) + A010873(n).

A292584 Compound filter: a(n) = P(A292583(n), A292585(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 2, 5, 2, 8, 5, 13, 2, 4, 8, 19, 5, 25, 13, 9, 2, 32, 4, 41, 8, 12, 19, 51, 5, 16, 25, 5, 13, 72, 9, 85, 2, 18, 32, 14, 4, 98, 41, 26, 8, 112, 12, 128, 19, 8, 51, 145, 5, 46, 16, 33, 25, 180, 5, 18, 13, 49, 72, 200, 9, 220, 85, 13, 2, 24, 18, 242, 32, 60, 14, 265, 4, 288, 98, 8, 41, 19, 26, 313, 8, 4, 112, 339, 12, 33, 128, 62, 19, 365, 8, 25, 51, 84, 145
Offset: 1

Views

Author

Antti Karttunen, Sep 20 2017

Keywords

Comments

From Antti Karttunen, Sep 25 2017: (Start)
Some of the sequences this filter matches to:
For all i, j: a(i) = a(j) => A053866(i) = A053866(j).
For all i, j: a(i) = a(j) => A061395(i) = A061395(j). (also A006530, etc.)
For all i, j: a(i) = a(j) => A292378(i) = A292378(j).
The latter two implications follow simply because:
and, similarly, for n > 1,
and the sum of A292375(n) and A292377(n) is A061395(n) [index of the largest prime dividing n], while A292378 has been defined as 1 + their difference.
The case A053866 follows because of the component A292583, see comments under that entry. (End)

Crossrefs

Cf. also A006530, A061395, A292378 (some of the matched sequences).

Formula

a(n) = (1/2)*(2 + ((A292583(n)+A292585(n))^2) - A292583(n) - 3*A292585(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).
Showing 1-10 of 11 results. Next