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

A329697 a(n) is the number of iterations needed to reach a power of 2 starting at n and using the map k -> k-(k/p), where p is the largest prime factor of k.

Original entry on oeis.org

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

Views

Author

Ali Sada and Robert G. Wilson v, Feb 28 2020

Keywords

Comments

From Antti Karttunen, Apr 07 2020: (Start)
Also the least number of iterations of nondeterministic map k -> k-(k/p) needed to reach a power of 2, when any prime factor p of k can be used. The minimal length path to the nearest power of 2 (= 2^A064415(n)) is realized whenever one uses any of the A005087(k) distinct odd prime factors of the current k, at any step of the process. For example, this could be done by iterating with the map k -> k-(k/A078701(k)), i.e., by using the least odd prime factor of k (instead of the largest prime).
Proof: Viewing the prime factorization of changing k as a multiset ("bag") of primes, we see that liquefying any odd prime p with step p -> (p-1) brings at least one more 2 to the bag, while applying p -> (p-1) to any 2 just removes it from the bag, but gives nothing back. Thus the largest (and thus also the nearest) power of 2 is reached by eliminating - step by step - all odd primes from the bag, but none of 2's, and it doesn't matter in which order this is done.
The above implies also that the sequence is totally additive, which also follows because both A064097 and A064415 are. That A064097(n) = A329697(n) + A054725(n) for all n > 1 can be also seen by comparing the initial conditions and the recursion formulas of these three sequences.
For any n, A333787(n) is either the nearest power of 2 reached (= 2^A064415(n)), or occurs on some of the paths from n to there.
(End)
A003401 gives the numbers k where a(k) = A005087(k). See also A336477. - Antti Karttunen, Mar 16 2021

Examples

			The trajectory of 15 is {12, 8}, taking 2 iterations to reach 8 = 2^3. So a(15) is 2.
From _Antti Karttunen_, Apr 07 2020: (Start)
Considering all possible paths from 15 to 1 nondeterministic map k -> k-(k/p), where p can be any prime factor of k, we obtain the following graph:
        15
       / \
      /   \
    10     12
    / \   / \
   /   \ /   \
  5     8     6
   \__  |  __/|
      \_|_/   |
        4     3
         \   /
          \ /
           2
           |
           1.
It can be seen that there's also alternative route to 8 via 10 (with 10 = 15-(15/3), where 3 is not the largest prime factor of 15), but it's not any shorter than the route via 12.
(End)
		

Crossrefs

Cf. A000079, A334101, A334102, A334103, A334104, A334105, A334106 for positions of 0 .. 6 in this sequence, and also array A334100.
Cf. A334099 (a right inverse, positions of the first occurrence of each n).
Cf. A334091 (first differences), A335429 (partial sums).
Cf. also A331410 (analogous sequence when using the map k -> k + k/p), A334861, A335877 (their sums and differences), see also A335878 and A335884, A335885.

Programs

  • Mathematica
    a[n_] := Length@ NestWhileList[# - #/FactorInteger[#][[-1, 1]] &, n, # != 2^IntegerExponent[#, 2] &] -1; Array[a, 100]
  • PARI
    A329697(n) = if(!bitand(n,n-1),0,1+A329697(n-(n/vecmax(factor(n)[, 1])))); \\ Antti Karttunen, Apr 07 2020
    
  • PARI
    up_to = 2^24;
    A329697list(up_to) = { my(v=vector(up_to)); v[1] = 0; for(n=2, up_to, v[n] = if(!bitand(n,n-1),0,1+vecmin(apply(p -> v[n-n/p], factor(n)[, 1]~)))); (v); };
    v329697 = A329697list(up_to);
    A329697(n) = v329697[n]; \\ Antti Karttunen, Apr 07 2020
    
  • PARI
    A329697(n) = if(n<=2,0, if(isprime(n), A329697(n-1)+1, my(f=factor(n)); (apply(A329697, f[, 1])~ * f[, 2]))); \\ Antti Karttunen, Apr 19 2020

Formula

From Antti Karttunen, Apr 07-19 2020: (Start)
a(1) = a(2) = 0; and for n > 2, a(p) = 1 + a(p-1) if p is an odd prime and a(n*m) = a(n) + a(m) if m,n > 1. [This is otherwise equal to the definition of A064097, except here we have a different initial condition, with a(2) = 0].
a(2n) = a(A000265(n)) = a(n).
a(p) = 1+a(p-1), for all odd primes p.
If A209229(n) == 1 [when n is a power of 2], a(n) = 0,
otherwise a(n) = 1 + a(n-A052126(n)) = 1 + a(A171462(n)).
Equivalently, for non-powers of 2, a(n) = 1 + a(n-(n/A078701(n))),
or equivalently, for non-powers of 2, a(n) = 1 + Min a(n - n/p), for p prime and dividing n.
a(n) = A064097(n) - A064415(n), or equally, a(n) = A064097(n) - A054725(n), for n > 1.
a(A019434(n)) = 1, a(A334092(n)) = 2, a(A334093(n)) = 3, etc. for all applicable n.
For all n >= 0, a(A334099(n)) = a(A000244(n)) = a(A000351(n)) = a(A001026(n)) = a(257^n) = a(65537^n) = n.
a(A122111(n)) = A334107(n), a(A225546(n)) = A334109(n).
(End)
From Antti Karttunen, Mar 16 2021: (Start)
a(n) = a(A336466(n)) + A087436(n) = A336396(n) + A087436(n).
a(A053575(n)) = A336469(n) = a(n) - A005087(n).
a(A147545(n)) = A000120(A147545(n)) - 1.
(End)

A331410 a(n) is the number of iterations needed to reach a power of 2 starting at n and using the map k -> k + k/p, where p is the largest prime factor of k.

Original entry on oeis.org

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

Views

Author

Ali Sada, Jan 16 2020

Keywords

Comments

Let f(n) = A000265(n) be the odd part of n. Let p be the largest prime factor of k, and say k = p * m. Suppose that k is not a power of 2, i.e., p > 2, then f(k) = p * f(m). The iteration is k -> k + k/p = p*m + m = (p+1) * m. So, p * f(m) -> f(p+1) * f(m). Since for p > 2, f(p+1) < p, the odd part in each iteration decreases, until it becomes 1, i.e., until we reach a power of 2. - Amiram Eldar, Feb 19 2020
Any odd prime factor of k can be used at any step of the iteration, and the result will be same. Thus, like A329697, this is also fully additive sequence. - Antti Karttunen, Apr 29 2020
If and only if a(n) is equal to A005087(n), then sigma(2n) - sigma(n) is a power of 2. (See A336923, A046528). - Antti Karttunen, Mar 16 2021

Examples

			The trajectory of 15 is [15,18,24,32], taking 3 iterations to reach 32. So, a(15) = 3.
		

Crossrefs

Cf. A000265, A005087, A006530 (greatest prime factor), A052126, A078701, A087436, A329662 (positions of records and the first occurrences of each n), A334097, A334098, A334108, A334861, A336467, A336921, A336922, A336923 (A046528).
Cf. array A335430, and its rows A335431, A335882, and also A335874.
Cf. also A329697 (analogous sequence when using the map k -> k - k/p), A335878.
Cf. also A330437, A335884, A335885, A336362, A336363 for other similar iterations.

Programs

  • Magma
    f:=func; g:=func; a:=[]; for n in [1..1000] do k:=n; s:=0; while not g(k) do  s:=s+1; k:=f(k); end while; Append(~a,s); end for; a; // Marius A. Burtea, Jan 19 2020
    
  • Mathematica
    a[n_] := -1 + Length @ NestWhileList[# + #/FactorInteger[#][[-1, 1]] &, n, # / 2^IntegerExponent[#, 2] != 1 &]; Array[a, 100] (* Amiram Eldar, Jan 16 2020 *)
  • PARI
    A331410(n) = if(!bitand(n,n-1),0,1+A331410(n+(n/vecmax(factor(n)[, 1])))); \\ Antti Karttunen, Apr 29 2020
    
  • PARI
    A331410(n) = { my(k=0); while(bitand(n,n-1), k++; my(f=factor(n)[, 1]); n += (n/f[2-(n%2)])); (k); }; \\ Antti Karttunen, Apr 29 2020
    
  • PARI
    A331410(n) = { my(f=factor(n)); sum(k=1,#f~,if(2==f[k,1],0,f[k,2]*(1+A331410(1+f[k,1])))); }; \\ Antti Karttunen, Apr 30 2020

Formula

From Antti Karttunen, Apr 29 2020: (Start)
This is a completely additive sequence: a(2) = 0, a(p) = 1+a(p+1) for odd primes p, a(m*n) = a(m)+a(n), if m,n > 1.
a(2n) = a(A000265(n)) = a(n).
If A209229(n) == 1, a(n) = 0, otherwise a(n) = 1 + a(n+A052126(n)), or equally, 1 + a(n+(n/A078701(n))).
a(n) = A334097(n) - A334098(n).
a(A122111(n)) = A334108(n).
(End)
a(n) = A334861(n) - A329697(n). - Antti Karttunen, May 14 2020
a(n) = a(A336467(n)) + A087436(n) = A336921(n) + A087436(n). - Antti Karttunen, Mar 16 2021

Extensions

Data section extended up to a(105) by Antti Karttunen, Apr 29 2020

A069482 a(n) = prime(n+1)^2 - prime(n)^2.

Original entry on oeis.org

5, 16, 24, 72, 48, 120, 72, 168, 312, 120, 408, 312, 168, 360, 600, 672, 240, 768, 552, 288, 912, 648, 1032, 1488, 792, 408, 840, 432, 888, 3360, 1032, 1608, 552, 2880, 600, 1848, 1920, 1320, 2040, 2112, 720, 3720, 768, 1560, 792, 4920, 5208, 1800, 912, 1848
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 29 2002, Aug 05 2007

Keywords

Comments

a(n) = A001248(n+1) - A001248(n) = A000040(n+1)^2 - A000040(n)^2 = (A000040(n+1) - A000040(n))*(A000040(n+1) + A000040(n)) = A001223(n)*A001043(n); together with A069484(n) and A069486(n) a Pythagorean triangle is formed with area = A069487(n).
For n>2: A078701(a(n)) = 3.
Except for the first two terms, these numbers are divisible by 24. Let p, q be consecutive primes. Then p > 3 = 3k+-1 and q = 3m+-1 and (3k+-1)^2 - (3m+-1)^2 is divisible by 3. Similarly, p = 4k+-1 and q=4m+-1 and (4k+-1)^2 - (4m+-1)^2 is divisible by 8. So 8 and 3 divide q^2 - p^2 => 24 divides q^2 - p^2. - Cino Hilliard, May 28 2009
Repetition of a(n) values occurs with decreasing frequency but increasing tallies (i.e., number of repetitions of a given value).
Tally = 2, first a(n) value is 72, with first n=4, prime=7.
Tally = 3, first a(n) value is 1848, with first n=36, prime=151.
Tally = 4, first a(n) value is 4920, with first n=46, prime=199.
Tally = 5, first a(n) value is 187117320, with first n=224752, prime 3118607.
Three a(n) values have a tally = 5, and none with tally > 5 for n<10,000,000. Note: Tallies for a given a(n) value are "confirmed" (i.e., not to be greater) only after examining a(n) values for all p(n) <= r/4-1, where r is the a(n) value in question, because twin primes provide the last chance for adding to the tally of any a(n) value. Tallies for the four a(n) values above are "confirmed" and all of them rely on twin primes for their last repetition. Thus r/4 +-1 is prime for the above four cases. However this is not true for all a(n) values that repeat.
Conjecture: The sum of prime factors with repetition (sopfr) applied to a(n), A001414(a(n)), covers all integers covered by sopfr, except 2,3,4,6,7,10,13,15. See A001414 for the sopfr sequence, which does not cover 0 and 1. - Richard R. Forberg, Feb 07 2015
Conjecture: There is no upper bound on the number of repetitions (i.e., size of a tally) that will occur for some a(n) values, because the number of possible ways of producing a value of a(n) grows with increasing n, despite decreasing prime density. This happens because there is increasing range in the size of prime gaps which increases the range of primes that can produce the same a(n) value much faster than the decrease in prime density which is decelerating with larger n. - Richard R. Forberg, Feb 17 2015

Examples

			A000040(10)=29, A000040(10+1)=31, A001248(10)=841, A001248(10+1)=961, a(10) = 961 - 841 = 120, A069486(10) = 2*31*29 = 1798, A069484(10) = 961 + 841 = 1802:
120^2 + 1798^2 = 14400 + 3232804 = 3247204 = 1802^2.
		

Crossrefs

Programs

  • Haskell
    a069482 n = a069482_list !! (n-1)
    a069482_list = zipWith (-) (tail a001248_list) a001248_list
    -- Reinhard Zumkeller, Jun 08 2015
    
  • Magma
    [NthPrime(n+1)^2 - NthPrime(n)^2: n in [1..40]]; // G. C. Greubel, May 19 2019
    
  • Mathematica
    Table[Prime[n+1]^2 - Prime[n]^2, {n, 1, 40}] (* Vladimir Joseph Stephan Orlovsky, Mar 01 2009; modified by G. C. Greubel, May 19 2019 *)
    #[[2]]-#[[1]]&/@Partition[Prime[Range[60]]^2,2,1] (* Harvey P. Dale, Jan 13 2011 *)
    Differences[Prime[Range[100]]^2](* Waldemar Puszkarz, Feb 09 2015 *)
  • PARI
    {a(n) = prime(n+1)^2 - prime(n)^2}; \\ G. C. Greubel, May 19 2019
    
  • Python
    from sympy import prime, primerange
    def aupton(terms):
      p = list(primerange(1, prime(terms+1)+1))
      return [p[n+1]**2-p[n]**2 for n in range(terms)]
    print(aupton(50)) # Michael S. Branicky, May 16 2021
  • Sage
    [nth_prime(n+1)^2 - nth_prime(n)^2 for n in (1..40)] # G. C. Greubel, May 19 2019
    

A070776 Numbers k such that number of terms in the k-th cyclotomic polynomial is equal to the largest prime factor of k.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 34, 36, 37, 38, 40, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 56, 58, 59, 61, 62, 64, 67, 68, 71, 72, 73, 74, 76, 79, 80, 81, 82, 83, 86, 88, 89, 92, 94, 96, 97, 98, 100
Offset: 1

Views

Author

Labos Elemer, May 07 2002

Keywords

Comments

Numbers k such that A051664(k) = A006530(k).
This is also numbers in the form of 2^i*p^j, i >= 0 and j >= 0, p is an odd prime number. - Lei Zhou, Feb 18 2012
From Zhou's formulation (where the exponents i and j should actually have been specified as i > 0 OR j > 0, to exclude 1) it follows that this is a subsequence of A324109. It also follows that A005940(a(n)) = A324106(a(n)) for all n >= 1. - Antti Karttunen, Feb 15 2019
Also from Zhou's formulation, the union (disjoint) of A000079\{1} and A336101. - Peter Munn, Jul 16 2020
Numbers k>=2 such that A078701(k) = A299766(k). - Juri-Stepan Gerasimov, Jun 02 2021

Examples

			n=10: Cyclotomic[10,x]=1-x+x^2-x^3+x^4 with 5 terms [including 1] which equals largest prime factor (5) of 10=n.
		

Crossrefs

Positions of zeros in A070536.
Subsequence of A324109.
Subsequences: A000079\{1}, A336101.

Programs

  • Mathematica
    Select[Range[1000],(a=FactorInteger[#];b=Length[a];(b==1)||((b==2)&&(a[[1]][[1]]==2)))&] (* Lei Zhou, Feb 18 2012 *)
  • PARI
    A006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1); \\ From A006530.
    A051664(n) = length(select(x->x!=0, Vec(polcyclo(n)))); \\ After program in A051664
    A070536(n) = (A051664(n) - A006530(n));
    isA070776(n) = (!A070536(n)); \\ Antti Karttunen, Feb 15 2019
    k=0; n=0; while(k<10000, n++; if(isA070776(n), k++; write("b070776.txt", k, " ", n)));

A136655 Product of odd divisors of n.

Original entry on oeis.org

1, 1, 3, 1, 5, 3, 7, 1, 27, 5, 11, 3, 13, 7, 225, 1, 17, 27, 19, 5, 441, 11, 23, 3, 125, 13, 729, 7, 29, 225, 31, 1, 1089, 17, 1225, 27, 37, 19, 1521, 5, 41, 441, 43, 11, 91125, 23, 47, 3, 343, 125, 2601, 13, 53, 729, 3025, 7, 3249, 29, 59, 225, 61, 31, 250047, 1, 4225, 1089
Offset: 1

Views

Author

Jonathan Vos Post, Jun 25 2008

Keywords

Comments

Product of rows of triangle A182469. - Reinhard Zumkeller, May 01 2012

Crossrefs

Programs

  • Haskell
    a136655 = product . a182469_row  -- Reinhard Zumkeller, May 01 2012
    
  • Maple
    with(numtheory); f:=proc(n) local t1,i,k; t1:=divisors(n); k:=1; for i in t1 do if i mod 2 = 1 then k:=k*i; fi; od; k; end; # N. J. A. Sloane, Jul 14 2008
  • Mathematica
    Array[Times @@ Select[Divisors@ #, OddQ] &, 66] (* Michael De Vlieger, Aug 03 2017 *)
    a[n_] := (oddpart = n/2^IntegerExponent[n, 2])^(DivisorSigma[0, oddpart]/2); Array[a, 100] (* Amiram Eldar, Jun 26 2022 *)
  • PARI
    a(n) = my(d=divisors(n)); prod(k=1, #d, if (d[k]%2, d[k], 1)); \\ Michel Marcus, Aug 04 2017
    
  • Python
    from math import isqrt
    from sympy import divisor_count
    def A136655(n):
        d = divisor_count(m:=n>>(~n&n-1).bit_length())
        return isqrt(m)**d if d&1 else m**(d>>1) # Chai Wah Wu, Jun 27 2025

Formula

a(p) = p if p noncomposite; a(2^n) = 1; a(pq) = p^2 * q^2 when p, q are odd primes.
a(n) = sqrt(n^od(n)/2^ed(n)), where od(n) = number of odd divisors of n = tau(2*n)-tau(n) and ed(n) = number of even divisors of n = 2*tau(n)-tau(2*n). - Vladeta Jovovic, Jun 25 2008
Also a(n) = A007955(A000265(n)). - David Wilson, Jun 26 2008
a(n) = Product_{h == 1 mod 4 and h | n}*Product_{i == 3 mod 4 and i | n}.
a(n) = Product_{j == 1 mod 6 and j | n}*Product_{k == 5 mod 6 and k | n}.
a(n) = A140210(n)*A140211(n). - R. J. Mathar, Jun 27 2008
a(n) = A007955(n) / A125911(n).

Extensions

More terms from N. J. A. Sloane, Jul 14 2008
Edited by N. J. A. Sloane, Aug 29 2008 at the suggestion of R. J. Mathar

A093803 Greatest odd proper divisor of n; a(1)=1.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 3, 5, 1, 3, 1, 7, 5, 1, 1, 9, 1, 5, 7, 11, 1, 3, 5, 13, 9, 7, 1, 15, 1, 1, 11, 17, 7, 9, 1, 19, 13, 5, 1, 21, 1, 11, 15, 23, 1, 3, 7, 25, 17, 13, 1, 27, 11, 7, 19, 29, 1, 15, 1, 31, 21, 1, 13, 33, 1, 17, 23, 35, 1, 9, 1, 37, 25, 19, 11, 39, 1, 5, 27, 41, 1, 21, 17
Offset: 1

Views

Author

Reinhard Zumkeller, May 19 2004

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory): a := n -> max(1,op(select(k->type(k,odd),divisors(n) minus {n}))): seq(a(n),n=1..85); # Peter Luschny, Feb 02 2015
  • Mathematica
    Join[{1},Table[Max[Select[Most[Divisors[n]],OddQ]],{n,2,90}]] (* Harvey P. Dale, Apr 10 2012 *)
    odd[n_] := n/2^IntegerExponent[n, 2]; a[n_] := odd[n/FactorInteger[n][[1, 1]]]; Array[a, 100] (* Amiram Eldar, Jul 04 2022 *)
  • PARI
    a(n)= my(x=if(n==1, 1, n/factor(n)[1, 1])); x >> valuation(x, 2); \\ Michel Marcus, Oct 26 2022
    
  • Python
    from math import prod
    from sympy import factorint
    def A093803(n):
        if n == 1: return 1
        f = factorint(n)
        m = min(f)
        return prod(p**(0 if p == 2 else e-1 if p == m else e) for p,e in f.items()) # Chai Wah Wu, Oct 27 2022
  • Scheme
    (define (A093803 n) (/ n (if (odd? n) (A020639 n) (A006519 n)))) ;; Antti Karttunen, Aug 12 2017
    

Formula

a(n) <= A000265(n);
a(n) = n / (A020639(n)*(n mod 2) + A006519(n)*(1 - n mod 2)).
a(n) = A000265(A032742(n)). - Antti Karttunen, Aug 12 2017

A334097 a(n) is the exponent of the eventual power of 2 reached when starting from n and using the map k -> k + k/p, where p can be any odd prime factor of k, for example, the largest.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 6, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 7, 7, 6, 7, 7, 7, 6, 7, 7, 7, 7, 6, 6, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 8, 7, 7, 7, 8, 7, 8, 7, 8, 8, 7, 7, 7, 7, 8, 7, 7, 7, 8, 8, 8, 8, 7, 7, 8
Offset: 1

Views

Author

Antti Karttunen, Apr 29 2020

Keywords

Crossrefs

Cf. also A064415 (analogous sequence when using the map k -> k - k/p).

Programs

  • Mathematica
    Array[Log2@ NestWhile[# + #/FactorInteger[#][[-1, 1]] &, #, !IntegerQ@ Log2@ # &] &, 105] (* Michael De Vlieger, Apr 30 2020 *)
  • PARI
    A334097(n) = if(!bitand(n,n-1),valuation(n,2),my(f=factor(n)[, 1]); A334097(n+(n/f[2-(n%2)])));
    
  • PARI
    A334097(n) = if(!bitand(n,n-1),valuation(n,2),A334097(n+(n/vecmax(factor(n)[, 1]))));
    
  • PARI
    A334097(n) = { my(f=factor(n)); sum(k=1,#f~,if(2==f[k,1],f[k,2],f[k,2]*A334097(1+f[k,1]))); };

Formula

Totally additive sequence: a(2) = 1, a(p) = a(p+1) for odd primes p, a(m*n) = a(m)+a(n) for m, n > 1.
If A209229(n) == 1, a(n) = A007814(n), otherwise a(n) = a(n+A052126(n)), or equally, a(n) = a(n+(n/A078701(n))).
a(n) = A331410(n) + A334098(n) = A334862(n) + A064415(n).

A080212 Binomial(n, smallest odd prime factor of n).

Original entry on oeis.org

1, 2, 1, 4, 1, 20, 1, 8, 84, 252, 1, 220, 1, 3432, 455, 16, 1, 816, 1, 15504, 1330, 705432, 1, 2024, 53130, 10400600, 2925, 1184040, 1, 4060, 1, 32, 5456, 2333606220, 324632, 7140, 1, 35345263800, 9139, 658008, 1, 11480, 1, 7669339132, 14190
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 06 2003

Keywords

Comments

For n>1: a(n)=1 iff n is prime.

Crossrefs

A079083 Smallest odd prime factor of (prime(n)+1)*(prime(n+1)+1)/4.

Original entry on oeis.org

3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 19, 3, 3, 3, 3, 3, 3, 17, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 19, 41, 3, 3, 3, 3, 3, 3, 3, 3, 5, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 17, 3, 3, 3, 3, 3, 3, 3, 3, 13, 3, 3, 3, 3, 3, 11, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 131, 137
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 22 2002

Keywords

Crossrefs

Programs

  • Haskell
    a079083 = a078701 . a079079  -- Reinhard Zumkeller, Oct 08 2012
    
  • Mathematica
    odd[n_] := n / 2^IntegerExponent[n, 2]; a[n_] := FactorInteger[odd[(Prime[n]+1)*(Prime[n+1]+1)]][[1, 1]]; Array[a, 100] (* Amiram Eldar, Apr 06 2025 *)
  • PARI
    odd(n) = n >> valuation(n, 2);
    a(n) = factor(odd((prime(n)+1)*(prime(n+1)+1)))[1, 1]; \\ Amiram Eldar, Apr 06 2025

Formula

a(n) = A078701(A079079(n)).

A079431 Least m>n with same smallest odd prime factor as n.

Original entry on oeis.org

2, 4, 6, 8, 10, 9, 14, 16, 12, 20, 22, 15, 26, 28, 18, 32, 34, 21, 38, 25, 24, 44, 46, 27, 35, 52, 30, 49, 58, 33, 62, 64, 36, 68, 40, 39, 74, 76, 42, 50, 82, 45, 86, 88, 48, 92, 94, 51, 56, 55, 54, 104, 106, 57, 65, 77, 60, 116, 118, 63, 122, 124, 66, 128, 70, 69, 134, 136
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 09 2003

Keywords

Comments

A078701(a(n))=A078701(n), A078701(i)<>A078701(n), n
n + A078701(n) <= a(n) <= 2*n;
a(2^k) = 2^(k+1), as A078701(2^k) = 1.

Crossrefs

Cf. A079432(n) = a(a(n)).
Cf. A078701.

Programs

  • Maple
    N:= 100:
    A:= Vector(N):
    p:= 2:
    do
      p:= nextprime(p);
      if p > N then break fi;
      R:= select(k -> A[k] = 0, [$1..N]);
      S:= select(`<=`,R,N/p);
      A[p*S]:= Vector(p*R[2..1+nops(S)]);
    od:
    for k from 0 to ilog2(N) do A[2^k]:= 2^(k+1) od:
    convert(A,list); # Robert Israel, Oct 25 2017
  • Mathematica
    sopf[n_] := SelectFirst[FactorInteger[n][[All, 1]], # > 2&];
    a[n_] := For[p = sopf[n]; m = n+1, True, m++, If[p == sopf[m], Return[m]]];
    Array[a, 100] (* Jean-François Alcover, Mar 09 2019 *)
Showing 1-10 of 25 results. Next