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

A007733 Period of binary representation of 1/n. Also, multiplicative order of 2 modulo the odd part of n (= A000265(n)).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 3, 1, 6, 4, 10, 2, 12, 3, 4, 1, 8, 6, 18, 4, 6, 10, 11, 2, 20, 12, 18, 3, 28, 4, 5, 1, 10, 8, 12, 6, 36, 18, 12, 4, 20, 6, 14, 10, 12, 11, 23, 2, 21, 20, 8, 12, 52, 18, 20, 3, 18, 28, 58, 4, 60, 5, 6, 1, 12, 10, 66, 8, 22, 12, 35, 6, 9, 36, 20, 18, 30, 12, 39, 4, 54, 20, 82, 6
Offset: 1

Views

Author

N. J. A. Sloane, Hal Sampson (hals(AT)easynet.com)

Keywords

Comments

Also sequence of period lengths for n's when you do primality testing and calculate "2^k mod n" from k = 0..n. - Gottfried Helms, Oct 05 2000
Fractal sequence related to A002326: the even terms of this sequence are this sequence itself, constructed on A002326, whose terms are the odd terms of this sequence. - Alexandre Wajnberg, Apr 27 2005
It seems that a(n) is also the sum of the terms in one period of the base-2 MR-expansion of 1/n (see A136042 for definition). - John W. Layman, Jan 22 2009
Indices n such that a(n) divides n are listed in A068563. - Max Alekseyev, Aug 25 2013
a(n) is the smallest k such that x^n - 1 factors into n linear polynomials over GF(2^k). For example, a(12) = 2, and x^12 - 1 = (x - 1)^4*(x - w)^4*(x - (w + 1))^4 in GF(4), where w^2 + w + 1 = 0. - Jianing Song, Jan 20 2019

References

  • Simmons, G. J. The structure of the differentiation digraphs of binary sequences. Ars Combin. 35 (1993), A, 71-88, see Table 2. Math. Rev. 95f:05052.

Crossrefs

Cf. A136042. - John W. Layman, Jan 22 2009
Positions of records are A139099.

Programs

  • Haskell
    a007733 = a002326 . flip div 2 . subtract 1 . a000265
    -- Reinhard Zumkeller, Apr 13 2015
    
  • Mathematica
    f[n_] := MultiplicativeOrder[2, n/(2^IntegerExponent[n, 2])]; Array[f, 84] (* Robert G. Wilson v, Jun 10 2011 *)
  • PARI
    a(n) = znorder(Mod(2, n/2^valuation(n, 2))); \\ Michel Marcus, Apr 11 2015
    
  • Python
    from sympy.ntheory import n_order
    def A007733(n): return n_order(2,n>>(~n & n-1).bit_length()) # Chai Wah Wu, Jul 01 2022

Formula

a(n) = A002326((A000265(n) - 1)/2). - Max Alekseyev, Jun 11 2009

A336466 Fully multiplicative with a(p) = A000265(p-1) for any prime p, where A000265(k) gives the odd part of k.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 5, 1, 3, 3, 1, 1, 1, 1, 9, 1, 3, 5, 11, 1, 1, 3, 1, 3, 7, 1, 15, 1, 5, 1, 3, 1, 9, 9, 3, 1, 5, 3, 21, 5, 1, 11, 23, 1, 9, 1, 1, 3, 13, 1, 5, 3, 9, 7, 29, 1, 15, 15, 3, 1, 3, 5, 33, 1, 11, 3, 35, 1, 9, 9, 1, 9, 15, 3, 39, 1, 1, 5, 41, 3, 1, 21, 7, 5, 11, 1, 9, 11, 15, 23, 9, 1, 3, 9, 5, 1, 25, 1, 51, 3, 3
Offset: 1

Views

Author

Antti Karttunen, Jul 22 2020

Keywords

Comments

For the comment here, we extend the definition of the second kind of Cunningham chain (see Wikipedia-article) so that also isolated primes for which neither (p+1)/2 nor 2p-1 is a prime are considered to be in singular chains, that is, in chains of the length one. If we replace one or more instances of any particular odd prime factor p in n with any odd prime q in such a chain, so that m = (q^k)*n / p^(e-k), where e is the exponent of p of n, and k <= e is the number of instances of p replaced with q, then it holds that a(m) = a(n), and by induction, the value stays invariant for any number of such replacements. Note also that A001222, but not necessarily A001221 will stay invariant in such changes.
For example, if some of the odd prime divisors p of n are in A005382, then replacing it with 2p-1 (i.e., the corresponding terms of A005383), gives a new number m, for which a(m) = a(n). And vice versa, the same is true for any of the prime divisors > 3 of n that are in A005383, then replacing any one of them with (p+1)/2 will not affect the result. For example, a(37*37*37) = a(19*37*73) = 729 as 37 is both in A005382 and in A005383.
a(n) = A053575(n) for squarefree n (A005117). - Antti Karttunen, Mar 16 2021

Crossrefs

Programs

  • Mathematica
    Array[Times @@ Map[If[# <= 2, 1, (# - 1)/2^IntegerExponent[# - 1, 2]] &, Flatten[ConstantArray[#1, #2] & @@@ FactorInteger[#]]] &, 105] (* Michael De Vlieger, Jul 24 2020 *)
  • PARI
    A000265(n) = (n>>valuation(n,2));
    A336466(n) = { my(f=factor(n)); prod(k=1,#f~,A000265(f[k,1]-1)^f[k,2]); };

Formula

a(n) = A000265(A003958(n)) = A000265(A333787(n)).
a(A000010(n)) = A336468(n) = a(A053575(n)).
A329697(a(n)) = A336396(n) = A329697(n) - A087436(n).
a(n) = A335915(n) / A336467(n). - Antti Karttunen, Mar 16 2021

A053575 Odd part of phi(n): a(n) = A000265(A000010(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 5, 1, 3, 3, 1, 1, 1, 3, 9, 1, 3, 5, 11, 1, 5, 3, 9, 3, 7, 1, 15, 1, 5, 1, 3, 3, 9, 9, 3, 1, 5, 3, 21, 5, 3, 11, 23, 1, 21, 5, 1, 3, 13, 9, 5, 3, 9, 7, 29, 1, 15, 15, 9, 1, 3, 5, 33, 1, 11, 3, 35, 3, 9, 9, 5, 9, 15, 3, 39, 1, 27, 5, 41, 3, 1, 21, 7, 5, 11, 3, 9, 11, 15, 23
Offset: 1

Views

Author

Labos Elemer, Jan 18 2000

Keywords

Comments

This is not necessarily the squarefree kernel. E.g., for n=19, phi(19)=18 is divisible by 9, an odd square. Values at which this kernel is 1 correspond to A003401 (polygons constructible with ruler and compass).
Multiplicative with a(2^e) = 1, a(p^e) = p^(e-1)*A000265(p-1). - Christian G. Bower, May 16 2005

Examples

			n = 70 = 2*5*7, phi(70) = 24 = 8*3, so the odd kernel of phi(70) is a(70)=3. [corrected by _Bob Selcoe_, Aug 22 2017]
From _Bob Selcoe_, Aug 22 2017: (Start)
a(89) = 88/8 = 11.
For n = 8820, 8820 = 2^2*3^2*5*7^2; S = 3*5*7 = 105, n" = 3^2*5*7^2 = 2205. a(3)*a(5)*a(7) = 1*1*3 = 3; a(8820) = 3*2205/105 = 63.
(End)
		

Crossrefs

Programs

  • Haskell
    a053575 = a000265 . a000010  -- Reinhard Zumkeller, Oct 09 2013
  • Maple
    a:= n-> (t-> t/2^padic[ordp](t, 2))(numtheory[phi](n)):
    seq(a(n), n=1..80);  # Alois P. Heinz, Apr 14 2020
  • Mathematica
    Array[NestWhile[Ceiling[#/2] &, EulerPhi@ #, EvenQ] &, 94] (* Michael De Vlieger, Aug 22 2017 *) (* or *)
    t=Array[EulerPhi,94]; t/2^IntegerExponent[t,2] (* Giovanni Resta, Aug 23 2017 *)
  • PARI
    a(n)=n=eulerphi(n);n>>valuation(n,2) \\ Charles R Greathouse IV, Mar 05 2013
    

Formula

From Bob Selcoe, Aug 22 2017: (Start)
Let n" be the odd part of n, S be the odd squarefree kernel of n and p_i {i = 1..z} be all the prime factors of S. Then the sequence can be constructed by the following:
a(1) = 1;
a(n) = (n-1)" when n is prime; and
a(n) = Product_{i = 1..z} a(p_i)*n"/S when n is composite (see Examples).
(End)
From Antti Karttunen, Dec 27 2020: (Start)
a(n) = A336466(n) for squarefree n (see A005117).
A336466(a(n)) = A336468(n), A329697(a(n)) = A336469(n) = A329697(n) - A005087(n).
(End)

A268674 a(1) = 1, after which, for odd numbers: a(n) = A078898(n)-th number k for which A055396(k) = A055396(n)-1, and for even numbers: a(n) = a(A000265(n)).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 5, 1, 4, 3, 7, 2, 11, 5, 6, 1, 13, 4, 17, 3, 8, 7, 19, 2, 9, 11, 10, 5, 23, 6, 29, 1, 12, 13, 15, 4, 31, 17, 14, 3, 37, 8, 41, 7, 16, 19, 43, 2, 25, 9, 18, 11, 47, 10, 21, 5, 20, 23, 53, 6, 59, 29, 22, 1, 27, 12, 61, 13, 24, 15, 67, 4, 71, 31, 26, 17, 35, 14, 73, 3, 28, 37, 79, 8, 33, 41, 30, 7
Offset: 1

Views

Author

Antti Karttunen, Feb 11 2016

Keywords

Comments

For odd numbers n > 1, a(n) tells which term is on the immediately preceding row of A083221, in the same column where n itself is.
The sequence offers a left inverse for A250469 that is slightly easier to compute than A250470.

Crossrefs

Left inverse of A250469.
Cf. also A064989.
Differs from A250470 for the first time at n=42, where a(42)=8, while A250470(42) = 10.

Programs

  • Mathematica
    (* b = A250469 *) b[1] = 1; b[n_] := If[PrimeQ[n], NextPrime[n], m1 = p1 = FactorInteger[n][[1, 1]]; For[ k1 = 1, m1 <= n, m1 += p1; If[m1 == n, Break[]]; If[ FactorInteger[m1][[1, 1]] == p1, k1++]]; m2 = p2 = NextPrime[p1]; For[k2 = 1, True, m2 += p2, If[ FactorInteger[m2][[1, 1]] == p2, k2++]; If[k1 + 2 == k2, Return[m2]]]];
    a[1] = a[2] = 1; a[n_?EvenQ] := a[n] = a[n/2]; a[n_] := a[n] = For[k = 1, True, k++, If[b[k] == n, Return[k]]];
    Array[a, 100] (* Jean-François Alcover, Mar 14 2016 *)

Formula

a(1) = 1, after which, a(n) = a(A000265(n)) if n is even, otherwise for odd n, a(n) = A083221(A055396(n)-1, A078898(n)).
Other identities. For all n >= 1:
a(A250469(n)) = n. [This works as a left inverse for sequence A250469.]
a(2n) = a(n). [The even bisection gives the whole sequence back.]
a(2n-1) = A250470(2n-1). [Matches with A250470 on odd numbers.]
a(A000040(n+1)) = A000040(n). [Maps each odd prime to the preceding prime.]
a(A001248(n+1)) = A001248(n). [Maps each square of an odd prime to the square of the preceding prime.]

A322993 a(1) = 0; for n > 1, a(n) = A000265(A156552(n)).

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 1, 7, 3, 9, 1, 11, 1, 17, 5, 15, 1, 13, 1, 19, 9, 33, 1, 23, 3, 65, 7, 35, 1, 21, 1, 31, 17, 129, 5, 27, 1, 257, 33, 39, 1, 37, 1, 67, 11, 513, 1, 47, 3, 25, 65, 131, 1, 29, 9, 71, 129, 1025, 1, 43, 1, 2049, 19, 63, 17, 69, 1, 259, 257, 41, 1, 55, 1, 4097, 13, 515, 5, 133, 1, 79, 15, 8193, 1, 75, 33, 16385, 513, 135, 1, 45, 9
Offset: 1

Views

Author

Antti Karttunen, Jan 02 2019

Keywords

Crossrefs

Cf. A000265, A156552, A246277, A305897 (restricted growth sequence transform), A322994 (Möbius transform).
Cf. also A322995.

Programs

  • Mathematica
    Array[#/2^IntegerExponent[#, 2] &@ Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ #]] &, 91] (* Michael De Vlieger, Jan 03 2019 *)
  • PARI
    A000265(n) = (n/2^valuation(n, 2));
    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)};
    A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));
    A322993(n) = if(1==n,0,A000265(A156552(n)));

Formula

a(1) = 0; for n > 1, a(n) = A000265(A156552(n)).
For n > 1, a(n) = A156552(2*A246277(n)).
A000120(a(n)) = A001222(n) for all n >= 1.

A335915 Fully multiplicative with a(2) = 1, and a(p) = A000265(p-1)*A000265(p+1) = A000265(p^2 - 1), for odd primes p.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 3, 1, 1, 3, 15, 1, 21, 3, 3, 1, 9, 1, 45, 3, 3, 15, 33, 1, 9, 21, 1, 3, 105, 3, 15, 1, 15, 9, 9, 1, 171, 45, 21, 3, 105, 3, 231, 15, 3, 33, 69, 1, 9, 9, 9, 21, 351, 1, 45, 3, 45, 105, 435, 3, 465, 15, 3, 1, 63, 15, 561, 9, 33, 9, 315, 1, 333, 171, 9, 45, 45, 21, 195, 3, 1, 105, 861, 3, 27, 231, 105, 15, 495, 3, 63, 33, 15, 69
Offset: 1

Views

Author

Antti Karttunen, Jul 09 2020

Keywords

Comments

For all i, j: A324400(i) = A324400(j) => a(i) = a(j) => A336118(i) = A336118(j).

Crossrefs

Programs

  • PARI
    A000265(n) = (n>>valuation(n,2));
    A335915(n) = { my(f=factor(n)); prod(k=1,#f~,if(2==f[k,1],1,(A000265(f[k,1]-1)*A000265(f[k,1]+1))^f[k,2])); };

Formula

Completely multiplicative with a(2) = 1, and for odd primes p, a(p) = A000265(p-1)*A000265(p+1).
For all n >= 1, A335904(a(n)) = A336118(n).
For all n >= 0, a(2^n) = a(3^n) = 1, a(5^n) = a(7^n) = 3^n.
a(n) = A336466(n) * A336467(n). - Antti Karttunen, Jan 31 2021

A336158 The least number with the prime signature of the odd part of n: a(n) = A046523(A000265(n)).

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 4, 2, 2, 2, 2, 2, 6, 1, 2, 4, 2, 2, 6, 2, 2, 2, 4, 2, 8, 2, 2, 6, 2, 1, 6, 2, 6, 4, 2, 2, 6, 2, 2, 6, 2, 2, 12, 2, 2, 2, 4, 4, 6, 2, 2, 8, 6, 2, 6, 2, 2, 6, 2, 2, 12, 1, 6, 6, 2, 2, 6, 6, 2, 4, 2, 2, 12, 2, 6, 6, 2, 2, 16, 2, 2, 6, 6, 2, 6, 2, 2, 12, 6, 2, 6, 2, 6, 2, 2, 4, 12, 4, 2, 6, 2, 2, 30
Offset: 1

Views

Author

Antti Karttunen, Jul 11 2020

Keywords

Crossrefs

Programs

  • PARI
    A000265(n) = (n>>valuation(n,2));
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A336158(n) = A046523(A000265(n));
    
  • Python
    from math import prod
    from sympy import factorint, prime
    def A336158(n): return prod(prime(i+1)**e for i,e in enumerate(sorted(factorint(n>>(~n&n-1).bit_length()).values(),reverse=True))) # Chai Wah Wu, Sep 16 2022

Formula

a(n) = A046523(A000265(n)) = A046523(A064989(n)).
A000005(a(n)) = A001227(n).
A001221(a(n)) = A005087(n).
A001222(a(n)) = A087436(n).

A336467 Fully multiplicative with a(2) = 1 and a(p) = A000265(p+1) for odd primes p, with A000265(k) giving the odd part of k.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 3, 1, 7, 1, 3, 1, 9, 1, 5, 3, 1, 3, 3, 1, 9, 7, 1, 1, 15, 3, 1, 1, 3, 9, 3, 1, 19, 5, 7, 3, 21, 1, 11, 3, 3, 3, 3, 1, 1, 9, 9, 7, 27, 1, 9, 1, 5, 15, 15, 3, 31, 1, 1, 1, 21, 3, 17, 9, 3, 3, 9, 1, 37, 19, 9, 5, 3, 7, 5, 3, 1, 21, 21, 1, 27, 11, 15, 3, 45, 3, 7, 3, 1, 3, 15, 1, 49, 1, 3, 9, 51, 9, 13, 7, 3
Offset: 1

Views

Author

Antti Karttunen, Jul 22 2020

Keywords

Comments

For the comment here, we extend the definition of the first kind of Cunningham chain (see Wikipedia-article) so that also isolated primes for which neither (p-1)/2 nor 2p+1 is a prime are considered to be in singular chains, that is, in chains of the length one. If we replace one or more instances of any particular odd prime factor p in n with any odd prime q of the same Cunningham chain, so that m = (q^k)*n / p^(e-k), where e is the exponent of p of n, and k <= e is the number of instances of p replaced with q, then it holds that a(m) = a(n), and by induction, the value stays invariant for any number of such replacements. Note also that A001222, but not necessarily A001221 will stay invariant in such changes.
For example, if some of the odd prime divisors p of n are Sophie Germain primes (in A005384), then replacing any of them with 2p+1 ("safe primes", i.e., the corresponding terms of A005385), gives a new number m, for which a(m) = a(n). And vice versa, the same is true for any safe prime factors > 5 of n (that are in A005385), then replacing any one of them with (p-1)/2 will not affect the result. For example, a(5*11*23*47) = a(11*11*23*23) = a(5^4) = a(11^4) = a(23^4) = 81, as 5, 11, 23 and 47 are in the same Cunningham chain of the first kind.

Crossrefs

Cf. also A335915, A336466 (similar sequences).

Programs

  • PARI
    A000265(n) = (n>>valuation(n,2));
    A336467(n) = { my(f=factor(n)); prod(k=1,#f~,if(2==f[k,1],1,(A000265(f[k,1]+1))^f[k,2])); };

Formula

For all n >= 1, A331410(a(n)) = A336921(n).
From Antti Karttunen, Nov 21 2023: (Start)
a(n) = A335915(n) / A336466(n).
a(1) = 1, and for n > 1, a(n) = A000265(A206787(n)) * a(A336651(n)).
(End)

A179480 Let m>k>0 be odd numbers and denote by the symbol "m<->k" the value A000265(m-k). Then the sequence m<->k, m<->(m<->k), m<->(m<->(m<->k)), ... is periodic; a(n) is the smallest period in the case m=2*n-1, k=1.

Original entry on oeis.org

1, 1, 2, 1, 3, 3, 2, 1, 5, 2, 6, 5, 5, 7, 2, 1, 6, 9, 6, 3, 3, 6, 12, 10, 4, 13, 10, 3, 15, 15, 2, 1, 17, 10, 18, 2, 10, 14, 20, 13, 21, 2, 14, 4, 6, 4, 18, 11, 9, 25, 26, 4, 27, 9, 18, 5, 22, 4, 12, 27, 10, 25, 2, 1, 33, 6, 18, 15, 35, 22, 30, 3, 22, 37, 6, 12, 10, 13, 26
Offset: 2

Views

Author

Vladimir Shevelev, Jul 16 2010

Keywords

Comments

A dual sequence to A179382.
Let b = (2*n-1) and k = A003558(n-1). If a(n) is odd, b divides (2^k + 1); but if a(n) is even, b divides (2^k - 1). Examples: a(14) = 5, odd; with b = 27 and A003558(13) = 9. Then 27 divides (2^9 + 1) or 513 = 27 * 19. a(18) = 6, even. b = 35, with k= A003558(17) = 12. Then 35 divides (2^12 - 1). - Gary W. Adamson, Aug 20 2012.
Iff a(n) = n/2 or (n-1)/2, then 2*n - 1 is a prime with one coach and is in A216371. Examples: a(19) = 9, so 37 is in A216371. a(12) = 6, so 23 is in A216371. - _Gary W. Adamson, Sep 08 2012.

Examples

			If n=14, then m=27 and we have 27<->1=13, 27<->13=7, 27<->7=5, 27<->5=11, 27<->11=1. Thus a(14)=5.
		

Crossrefs

Programs

  • Maple
    Contribution from R. J. Mathar, Nov 04 2010: (Start)
    A179480aux := proc(x,y) local xtrack,xitr,xpos ; xtrack := [y] ; while true do xitr := A000265(x-op(-1,xtrack)) ; if not member(xitr, xtrack,'xpos') then xtrack := [op(xtrack),xitr] ; else return 1+nops(xtrack)-xpos ; end if; end do: end proc:
    A179480 := proc(n) A179480aux(2*n-1,1) ; end proc: seq(A179480(n),n=2..80) ; (End)
  • Mathematica
    oddres[n_] := n/2^IntegerExponent[n, 2];
    b[x_, y_] := Module[{xtrack = {y}, xitr}, While[True, xitr = oddres[x - Last@ xtrack]; If[FreeQ[xtrack, xitr], AppendTo[xtrack, xitr], Return[ Length[xtrack]]]]];
    a[n_] := b[2n-1, 1];
    a /@ Range[2, 80] (* Jean-François Alcover, Apr 13 2020, after R. J. Mathar *)

Extensions

Edited by N. J. A. Sloane, Jul 18 2010
More terms from R. J. Mathar, Nov 04 2010

A336698 a(n) = A000265(1+A000265(sigma(n))), where A000265(k) gives the odd part of k.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 7, 5, 1, 1, 1, 1, 1, 1, 5, 5, 3, 11, 1, 5, 1, 1, 1, 11, 3, 1, 1, 5, 1, 1, 1, 7, 1, 23, 5, 1, 1, 23, 11, 1, 3, 11, 5, 5, 1, 1, 29, 47, 5, 25, 7, 1, 5, 1, 3, 23, 1, 11, 1, 1, 7, 1, 11, 5, 9, 1, 1, 5, 5, 49, 19, 29, 1, 9, 1, 11, 3, 47, 61, 1, 11, 1, 7, 17, 1, 23, 23, 59, 1, 11, 1, 5, 1, 1, 25
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2020

Keywords

Crossrefs

Programs

Formula

a(n) = A000265(1+A000265(A000203(n))) = A000265(1+A161942(n)).
a(A000265(n)) = A336699(n).
Showing 1-10 of 728 results. Next