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 81 results. Next

A297113 a(1) = 0, a(2) = 1, after which, a(n) = a(n/2) if n is of the form 4k+2, and otherwise a(n) = 1+a(A252463(n)).

Original entry on oeis.org

0, 1, 2, 2, 3, 2, 4, 3, 3, 3, 5, 3, 6, 4, 3, 4, 7, 3, 8, 4, 4, 5, 9, 4, 4, 6, 4, 5, 10, 3, 11, 5, 5, 7, 4, 4, 12, 8, 6, 5, 13, 4, 14, 6, 4, 9, 15, 5, 5, 4, 7, 7, 16, 4, 5, 6, 8, 10, 17, 4, 18, 11, 5, 6, 6, 5, 19, 8, 9, 4, 20, 5, 21, 12, 4, 9, 5, 6, 22, 6, 5, 13, 23, 5, 7, 14, 10, 7, 24, 4, 6, 10, 11, 15, 8, 6, 25
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2017

Keywords

Comments

From Gus Wiseman, Apr 06 2019: (Start)
Also the number of squares in the Young diagram of the integer partition with Heinz number n that are graph-distance 1 from the lower-right boundary, where the Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). For example, the partition (6,5,5,3) with Heinz number 7865 has diagram
o o o o o o
o o o o o
o o o o o
o o o
with inner rim
o
o
o o
o o o
of size 7, so a(7867) = 7.
(End)

Crossrefs

Programs

  • Mathematica
    Table[If[n==1,0,PrimePi[FactorInteger[n][[-1,1]]]+PrimeOmega[n]-PrimeNu[n]],{n,100}] (* Gus Wiseman, Apr 06 2019 *)
  • 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)};
    A297113(n) = if(n<=2,n-1,if(n%2,1+A297113(A064989(n)), !(n%4)+A297113(n/2)));
    
  • PARI
    \\ More complex way, after Moebius transform:
    A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));
    A297112(n) = sumdiv(n,d,moebius(n/d)*A156552(d));
    A297113(n) = if(1==n,0,1+valuation(A297112(n),2));
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A297113 n) (cond ((<= n 2) (- n 1)) ((= 2 (modulo n 4)) (A297113 (/ n 2))) (else (+ 1 (A297113 (A252463 n))))))

Formula

a(1) = 0, a(2) = 1, after which, a(n) = a(n/2) if n is of the form 4k+2, and otherwise a(n) = 1+a(A252463(n)) .
For n > 1, a(n) = A001511(A297112(n)), where A297112(n) = Sum_{d|n} moebius(n/d)*A156552(d).
a(n) = A252464(n) - A297155(n).
For n > 1, a(n) = 1+A033265(A156552(n)) = 1+A297167(n) = A046660(n) + A061395(n). - Last two sums added by Antti Karttunen, Sep 02 2018
Other identities. For all n >= 1:
a(A000040(n)) = n. [Each n occurs for the first time at the n-th prime.]

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).

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

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 2, 0, 0, 1, 3, 1, 3, 2, 2, 0, 3, 0, 4, 1, 1, 3, 5, 1, 0, 3, 1, 2, 5, 2, 6, 0, 2, 3, 3, 0, 6, 4, 4, 1, 6, 1, 7, 3, 1, 5, 8, 1, 0, 0, 4, 3, 8, 1, 2, 2, 3, 5, 9, 2, 9, 6, 2, 0, 2, 2, 10, 3, 4, 3, 11, 0, 11, 6, 1, 4, 3, 4, 12, 1, 0, 6, 13, 1, 4, 7, 6, 3, 13, 1, 3, 5, 5, 8, 5, 1, 13, 0, 3, 0, 13, 4, 14, 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+3 encountered until 1 has been reached. The count includes also n itself if it is of the form 4k+3 (A004767).
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+3 that occur on the path.

Crossrefs

Programs

  • Mathematica
    a[1] = 0; 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] == 3]; Array[a, 105]

Formula

a(1) = 0, and for n > 1, a(n) = a(A252463(n)) + floor((n mod 4)/3).
Equivalently, a(2n) = a(n), and for odd numbers n > 1, a(n) = a(A064989(n)) + [n == 3 (mod 4)].
a(n) = A000120(A292383(n)).
Other identities. For n >= 1:
a(n) >= A292376(n).
a(A000040(n)) = A267098(n).
1 + a(n) - A292375(n) = A292378(n).
For n >= 2, a(n) + A292375(n) = A061395(n).

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

Original entry on oeis.org

1, 2, 4, 4, 9, 8, 18, 8, 9, 18, 36, 16, 73, 36, 16, 16, 147, 18, 294, 36, 37, 72, 588, 32, 19, 146, 16, 72, 1177, 32, 2354, 32, 73, 294, 32, 36, 4709, 588, 144, 72, 9419, 74, 18838, 144, 33, 1176, 37676, 64, 39, 38, 292, 292, 75353, 32, 74, 144, 589, 2354, 150706, 64, 301413, 4708, 72, 64, 147, 146, 602826, 588, 1177, 64, 1205652, 72, 2411305, 9418, 36, 1176
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

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

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] == 1, 1, 0], 2], {n, 76}] (* 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));
    A292381(n) = if(1==n,n,(if(1==(n%4),1,0)+(2*A292381(A252463(n)))));
    
  • 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 a292371(n):
        k=digits(n, 4)[1:]
        return 0 if n==0 else int("".join(['1' if i==1 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 a292371(a292384(n))
    print([a(n) for n in range(1, 111)]) # Indranil Ghosh, Sep 21 2017
  • Scheme
    (define (A292381 n) (A292371 (A292384 n)))
    

Formula

a(1) = 1; for n > 1, 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.
a(n) = A292371(A292384(n)).
Other identities. For n >= 1:
a(2n) = 2*a(n).
A000120(a(n)) = A292375(n).
For n >= 2, a(n) = A004754(A292385(n)).

A320107 a(n) = A001227(A252463(n)).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 1, 2, 2, 4, 2, 1, 2, 2, 4, 3, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 4, 4, 2, 2, 2, 2, 4, 2, 2, 2, 1, 4, 4, 2, 2, 2, 4, 2, 3, 2, 2, 3, 2, 4, 4, 2, 2, 1, 2, 2, 4, 4, 2, 2, 2, 2, 6, 4, 2, 2, 2, 4, 2, 2, 3, 2, 3, 2, 4, 2, 2, 4
Offset: 1

Views

Author

Antti Karttunen, Nov 22 2018

Keywords

Comments

Records 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 20, 24, 32, 36, 40, ... occur at n = 1, 5, 18, 30, 90, 210, 450, 630, 1890, 3150, 5670, 6930, 20790, 34650, 62370, ...

Crossrefs

Cf. A001227, A005940, A051064, A055457, A252463, A320106 (Möbius transform).

Programs

Formula

a(n) = A001227(A252463(n)).
a(1) = a(2) = 1; for n > 2, a(n) = a(n/2) when n == 0 mod 4, a(n) = A051064(n) * a(n/2) when n == 2 mod 4, a(n) = a(A064989(n)), when n == 3 mod 6, otherwise a(n) = A055457(n) * a(A064989(n)).
For n > 2, let p = A252463(n). If p is even, then a(n) = a(p), if p is odd, then a(n) = A051064(p) * a(p).

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)

A292943 a(n) = A292944(A243071(n)); Base-2 expansion of a(n) encodes the steps where numbers of the form 6k+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, 4, 0, 1, 4, 8, 4, 16, 8, 5, 0, 32, 2, 64, 8, 9, 16, 128, 8, 2, 32, 1, 16, 256, 10, 512, 0, 17, 64, 10, 4, 1024, 128, 33, 16, 2048, 18, 4096, 32, 9, 256, 8192, 16, 4, 4, 65, 64, 16384, 2, 18, 32, 129, 512, 32768, 20, 65536, 1024, 17, 0, 34, 34, 131072, 128, 257, 20, 262144, 8, 524288, 2048, 5, 256, 20, 66, 1048576, 32, 1, 4096
Offset: 1

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A292944(A243071(n)).
a(1) = 0, and for n > 1, a(n) = 2*a(A252463(n)) + [n == 3 (mod 6)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 6k+3, and 0 otherwise.
For n >= 0, a(A163511(n)) = A292944(n).
For n >= 1, A292941(n) + a(n) + A292945(n) = a(n) + A292253(n) + A292255(n) = A243071(n).

A319703 a(n) = A003415(A252463(n)).

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 4, 4, 1, 1, 5, 1, 1, 5, 12, 1, 6, 1, 7, 7, 1, 1, 16, 6, 1, 12, 9, 1, 8, 1, 32, 9, 1, 8, 21, 1, 1, 13, 24, 1, 10, 1, 13, 16, 1, 1, 44, 10, 10, 15, 15, 1, 27, 10, 32, 19, 1, 1, 31, 1, 1, 24, 80, 14, 14, 1, 19, 21, 12, 1, 60, 1, 1, 21, 21, 12, 16, 1, 68, 32, 1, 1, 41, 16, 1, 25, 48, 1, 39, 16, 25, 31, 1
Offset: 1

Views

Author

Antti Karttunen, Nov 22 2018

Keywords

Crossrefs

Programs

  • PARI
    A003415(n) = {my(fac); if(n<1, 0, fac=factor(n); sum(i=1, matsize(fac)[1], n*fac[i, 2]/fac[i, 1]))}; \\ From A003415
    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));
    A319703(n) = A003415(A252463(n));

Formula

a(n) = A003415(A252463(n)).

A348045 Möbius transform of A252463, where A252463 shifts the prime factorization of odd numbers one step towards smaller primes and divides even numbers by two.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 4, 2, 2, 2, 6, 2, 10, 2, 2, 4, 12, 4, 16, 4, 4, 4, 18, 4, 6, 2, 4, 6, 22, 6, 28, 8, 6, 4, 8, 6, 30, 2, 10, 8, 36, 8, 40, 10, 4, 4, 42, 8, 20, 14, 12, 12, 46, 14, 12, 12, 16, 6, 52, 8, 58, 2, 8, 16, 20, 14, 60, 16, 18, 16, 66, 12, 70, 6, 6, 18, 24, 14, 72, 16, 8, 4, 78, 12, 24, 2, 22, 20, 82, 20
Offset: 1

Views

Author

Antti Karttunen, Oct 12 2021

Keywords

Crossrefs

Cf. A008683, A064989, A252463, A285702 (odd bisection), A348046 (positions of 2's).
Cf. also A023022, A326305, A347115.

Programs

  • 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));
    A348045(n) = sumdiv(n,d,moebius(n/d)*A252463(d));

Formula

a(n) = Sum_{d|n} A008683(n/d) * A252463(d).
Showing 1-10 of 81 results. Next