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

A292253 a(1) = 0, a(2) = 1, and for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 2)]*[J(3|n) == 1], where J is the Jacobi-symbol.

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 8, 4, 4, 8, 17, 8, 35, 16, 8, 8, 70, 8, 140, 16, 16, 34, 281, 16, 9, 70, 8, 32, 562, 16, 1124, 16, 32, 140, 17, 16, 2249, 280, 68, 32, 4498, 32, 8996, 68, 16, 562, 17993, 32, 19, 18, 140, 140, 35986, 16, 32, 64, 280, 1124, 71973, 32, 143947, 2248, 32, 32, 64, 64, 287894, 280, 560, 34, 575789, 32, 1151579, 4498, 16, 560, 34, 136, 2303158, 64
Offset: 1

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

Base-2 expansion of a(n) encodes the steps where numbers that are either of the form 12k+1 or of the form 12k+11 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.
The AND - XOR formula(s) 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 (A292253 n) (if (<= n 2) (- n 1) (+ (if (and (odd? n) (= 1 (jacobi-symbol 3 n))) 1 0) (* 2 (A292253 (A252463 n))))))

Formula

a(1) = 0, a(2) = 1, and for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 2)]*[J(3|n) == 1], where J is the Jacobi-symbol, and [ ]'s are Iverson brackets, whose product gives 1 only if n is an odd number for which J(3|n) = +1, and 0 otherwise.
a(n) = A292263(n) AND (A292383(n) XOR A292941(n)), where AND is bitwise-and (A004198) and XOR is bitwise-XOR (A003987). [See comments.]
For n >= 0, a(A163511(n)) = A292254(n).
For n >= 1, a(n) + A292255(n) + A292943(n) = A243071(n).

A292255 a(1) = 0, and for n > 1, a(n) = 2*a(A252463(n)) + [n == 1 (mod 2)]*[J(3|n) == -1], where J is the Jacobi-symbol.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 3, 0, 0, 2, 6, 0, 12, 6, 0, 0, 25, 0, 51, 4, 4, 12, 102, 0, 0, 24, 0, 12, 205, 0, 411, 0, 12, 50, 0, 0, 822, 102, 24, 8, 1645, 8, 3291, 24, 0, 204, 6582, 0, 0, 0, 48, 48, 13165, 0, 9, 24, 100, 410, 26330, 0, 52660, 822, 8, 0, 25, 24, 105321, 100, 204, 0, 210642, 0, 421284, 1644, 0, 204, 1, 48, 842569, 16, 0, 3290, 1685138, 16, 48, 6582
Offset: 1

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

Base-2 expansion of a(n) encodes the steps where numbers that are either of the form 12k+5 or of the form 12k+7 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n.
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 (A292255 n) (if (<= n 1) 0 (+ (if (and (odd? n) (= -1 (jacobi-symbol 3 n))) 1 0) (* 2 (A292255 (A252463 n))))))

Formula

a(1) = 0, and for n > 1, a(n) = 2*a(A252463(n)) + [n == 1 (mod 2)]*[J(3|n) == -1], where J is the Jacobi-symbol, and [ ]'s are Iverson brackets, whose product gives 1 only if n is an odd number for which J(3|n) = -1, and 0 otherwise.
a(n) = A292263(n) AND (A292383(n) XOR A292945(n)), where AND is bitwise-and (A004198) and XOR is bitwise-XOR (A003987).
a(n) = A292263(n) AND (A292385(n) XOR A292941(n)). [See comments.]
For n >= 0, a(A163511(n)) = A292256(n).
For n >= 1, a(n) + A292253(n) + A292943(n) = A243071(n).

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

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

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 2, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 2, 0, 1, 0, 1, 1, 1, 1, 2, 0, 1, 0, 1, 0, 2, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 2, 0, 1, 2
Offset: 1

Views

Author

Antti Karttunen, Dec 27 2017

Keywords

Comments

Consider the binary tree illustrated in A005940: If we start from any vertex containing n, computing successive iterations of A252463 until 1 is reached, a(n) gives the number of the numbers of the form 4k+2 (with k >= 1) encountered on the path (i.e., excluding 2 from the count but including the starting n if it is of the form 4k+2).

Crossrefs

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)};
    A297155(n) = if(n<=2,0,if(n%2,A297155(A064989(n)),(2==(n%4))+A297155(n/2)));
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A297155 n) (cond ((<= n 2) 0) ((= 2 (modulo n 4)) (+ 1 (A297155 (/ n 2)))) (else (A297155 (A252463 n)))))

Formula

a(n) = A252464(n) - A297113(n).
a(n) = A037800(A156552(n)).
a(n) = A001221(n) - 1 for all n > 1. - Velin Yanev, Mar 26 2019

A319699 a(n) = A001065(A252463(n)).

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 3, 3, 1, 1, 6, 1, 1, 6, 7, 1, 4, 1, 8, 8, 1, 1, 16, 4, 1, 7, 10, 1, 9, 1, 15, 10, 1, 9, 21, 1, 1, 14, 22, 1, 11, 1, 14, 16, 1, 1, 36, 6, 6, 16, 16, 1, 13, 11, 28, 20, 1, 1, 42, 1, 1, 22, 31, 15, 15, 1, 20, 22, 13, 1, 55, 1, 1, 21, 22, 13, 17, 1, 50, 15, 1, 1, 54, 17, 1, 26, 40, 1, 33, 17, 26, 32, 1, 21, 76, 1, 8, 28, 43, 1, 21, 1, 46, 42
Offset: 1

Views

Author

Antti Karttunen, Nov 22 2018

Keywords

Comments

Also for n > 1, sum of A318889(x) for all x encountered when map x -> A252463(x) is iterated, starting from x = A252463(n), until 1 is reached.

Crossrefs

Programs

Formula

a(n) = A001065(A252463(n)).
a(n) = A001065(n) - A318889(n).

A319700 a(n) = A051953(A252463(n)).

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 4, 1, 1, 4, 4, 1, 3, 1, 6, 6, 1, 1, 8, 3, 1, 4, 8, 1, 7, 1, 8, 8, 1, 7, 12, 1, 1, 12, 12, 1, 9, 1, 12, 8, 1, 1, 16, 5, 5, 14, 14, 1, 9, 9, 16, 18, 1, 1, 22, 1, 1, 12, 16, 13, 13, 1, 18, 20, 11, 1, 24, 1, 1, 12, 20, 11, 15, 1, 24, 8, 1, 1, 30, 15, 1, 24, 24, 1, 21, 15, 24, 30, 1, 19, 32, 1, 7, 16, 30, 1, 19, 1, 28, 22
Offset: 1

Views

Author

Antti Karttunen, Nov 22 2018

Keywords

Crossrefs

Programs

  • PARI
    A051953(n) = (n - eulerphi(n));
    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));
    A319700(n) = A051953(A252463(n));

Formula

a(n) = A051953(A252463(n)).

A319989 a(n) = A303757(A252463(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 22 2018

Keywords

Crossrefs

Programs

  • Mathematica
    Block[{s = Table[Which[n == 1, 1, EvenQ@n, n/2, True, Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n], {n, 120}], t}, t = EulerPhi@ Range@ Max@ s; Map[Function[n, Count[t[[2 ;; n]], ?(# == t[[n]] &)]], s] /. 0 -> 1] (* _Michael De Vlieger, Nov 23 2018 *)
  • PARI
    up_to = 65537;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    Aux303757(n) = if(1==n,0,eulerphi(n));
    v303757 = ordinal_transform(vector(up_to,n,Aux303757(n)));
    A303757(n) = v303757[n];
    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));
    A319989(n) = A303757(A252463(n));

Formula

a(n) = A303757(A252463(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).
Previous Showing 11-20 of 81 results. Next