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

A046951 a(n) is the number of squares dividing n.

Original entry on oeis.org

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

Views

Author

Simon Colton (simonco(AT)cs.york.ac.uk)

Keywords

Comments

Rediscovered by the HR automatic theory formation program.
a(n) depends only on prime signature of n (cf. A025487, A046523). So a(24) = a(375) since 24 = 2^3*3 and 375 = 3*5^3 both have prime signature (3, 1).
First differences of A013936. Average value tends towards Pi^2/6 = 1.644934... (A013661, A013679). - Henry Bottomley, Aug 16 2001
We have a(n) = A159631(n) for all n < 125, but a(125) = 2 < 3 = A159631(125). - Steven Finch, Apr 22 2009
Number of 2-generated Abelian groups of order n, if n > 1. - Álvar Ibeas, Dec 22 2014 [In other words, number of order-n abelian groups with rank <= 2. Proof: let b(n) be such number. A finite abelian group is the inner direct product of all Sylow-p subgroups, so {b(n)} is multiplicative. Obviously b(p^e) = floor(e/2)+1 (corresponding to the groups C_(p^r) X C_(p^(e-r)) for 0 <= r <= floor(e/2)), hence b(n) = a(n) for all n. - Jianing Song, Nov 05 2022]
Number of ways of writing n = r*s such that r|s. - Eric M. Schmidt, Jan 08 2015
The number of divisors of the square root of the largest square dividing n. - Amiram Eldar, Jul 07 2020
The number of unordered factorizations of n into cubefree powers of primes (1, primes and squares of primes, A166684). - Amiram Eldar, Jun 12 2025

Examples

			a(16) = 3 because the squares 1, 4, and 16 divide 16.
G.f. = x + x^2 + x^3 + 2*x^4 + x^5 + x^6 + x^7 + 2*x^8 + 2*x^9 + x^10 + ...
		

Crossrefs

One more than A071325.
Differs from A096309 for the first time at n=32, where a(32) = 3, while A096309(32) = 2 (and also A185102(32) = 2).
Sum of the k-th powers of the square divisors of n for k=0..10: this sequence (k=0), A035316 (k=1), A351307 (k=2), A351308 (k=3), A351309 (k=4), A351310 (k=5), A351311 (k=6), A351313 (k=7), A351314 (k=8), A351315 (k=9), A351315 (k=10).
Sequences of the form n^k * Sum_{d^2|n} 1/d^k for k = 0..10: this sequence (k=0), A340774 (k=1), A351600 (k=2), A351601 (k=3), A351602 (k=4), A351603 (k=5), A351604 (k=6), A351605 (k=7), A351606 (k=8), A351607 (k=9), A351608 (k=10).
Cf. A082293 (a(n)==2), A082294 (a(n)==3).

Programs

  • Haskell
    a046951 = sum . map a010052 . a027750_row
    -- Reinhard Zumkeller, Dec 16 2013
    
  • Magma
    [#[d: d in Divisors(n)|IsSquare(d)]:n in [1..120]]; // Marius A. Burtea, Jan 21 2020
    
  • Maple
    A046951 := proc(n)
        local a,s;
        a := 1 ;
        for p in ifactors(n)[2] do
            a := a*(1+floor(op(2,p)/2)) ;
        end do:
        a ;
    end proc: # R. J. Mathar, Sep 17 2012
    # Alternatively:
    isbidivisible := (n, d) -> igcd(n, d) = d and igcd(n/d, d) = d:
    a := n -> nops(select(k -> isbidivisible(n, k), [seq(1..n)])): # Peter Luschny, Jun 13 2025
  • Mathematica
    a[n_] := Length[ Select[ Divisors[n], IntegerQ[Sqrt[#]]& ] ]; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Jun 26 2012 *)
    Table[Length[Intersection[Divisors[n], Range[10]^2]], {n, 100}] (* Alonso del Arte, Dec 10 2012 *)
    a[ n_] := If[ n < 1, 0, Sum[ Mod[ DivisorSigma[ 0, d], 2], {d, Divisors @ n}]]; (* Michael Somos, Jun 13 2014 *)
    a[ n_] := If[ n < 2, Boole[ n == 1], Times @@ (Quotient[ #[[2]], 2] + 1 & /@ FactorInteger @ n)]; (* Michael Somos, Jun 13 2014 *)
    a[ n_] := If[ n < 0, 0, SeriesCoefficient[ Sum[ x^k^2 / (1 - x^k^2), {k, Sqrt @ n}], {x, 0, n}]]; (* Michael Somos, Jun 13 2014 *)
    f[p_, e_] := 1 + Floor[e/2]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Sep 15 2020 *)
  • PARI
    a(n)=my(f=factor(n));for(i=1,#f[,1],f[i,2]\=2);numdiv(factorback(f)) \\ Charles R Greathouse IV, Dec 11 2012
    
  • PARI
    a(n) = direuler(p=2, n, 1/((1-X^2)*(1-X)))[n]; \\ Michel Marcus, Mar 08 2015
    
  • PARI
    a(n)=factorback(apply(e->e\2+1, factor(n)[,2])) \\ Charles R Greathouse IV, Sep 17 2015
    
  • Python
    from math import prod
    from sympy import factorint
    def A046951(n): return prod((e>>1)+1 for e in factorint(n).values()) # Chai Wah Wu, Aug 04 2024
    
  • Python
    def is_bidivisible(n, d) -> bool: return gcd(n, d) == d and gcd(n//d, d) == d
    def aList(n) -> list[int]: return [k for k in range(1, n+1) if is_bidivisible(n, k)]
    print([len(aList(n)) for n in range(1, 126)])  # Peter Luschny, Jun 13 2025
  • Scheme
    (definec (A046951 n) (if (= 1 n) 1 (* (A008619 (A007814 n)) (A046951 (A064989 n)))))
    (define (A008619 n) (+ 1 (/ (- n (modulo n 2)) 2)))
    ;; Antti Karttunen, Nov 14 2016
    

Formula

a(p^k) = A008619(k) = [k/2] + 1. a(A002110(n)) = 1 for all n. (This is true for any squarefree number, A005117). - Original notes clarified by Antti Karttunen, Nov 14 2016
a(n) = |{(i, j) : i*j = n AND i|j}| = |{(i, j) : i*j^2 = n}|. Also tau(A000188(n)), where tau = A000005.
Multiplicative with p^e --> floor(e/2) + 1, p prime. - Reinhard Zumkeller, May 20 2007
a(A130279(n)) = n and a(m) <> n for m < A130279(n); A008966(n)=0^(a(n) - 1). - Reinhard Zumkeller, May 20 2007
Inverse Moebius transform of characteristic function of squares (A010052). Dirichlet g.f.: zeta(s)*zeta(2s).
G.f.: Sum_{k > 0} x^(k^2)/(1 - x^(k^2)). - Vladeta Jovovic, Dec 13 2002
a(n) = Sum_{k=1..A000005(n)} A010052(A027750(n,k)). - Reinhard Zumkeller, Dec 16 2013
a(n) = Sum_{k = 1..n} ( floor(n/k^2) - floor((n-1)/k^2) ). - Peter Bala, Feb 17 2014
From Antti Karttunen, Nov 14 2016: (Start)
a(1) = 1; for n > 1, a(n) = A008619(A007814(n)) * a(A064989(n)).
a(n) = A278161(A156552(n)). (End)
G.f.: Sum_{k>0}(theta(q^k)-1)/2, where theta(q)=1+2q+2q^4+2q^9+2q^16+... - Mamuka Jibladze, Dec 04 2016
From Antti Karttunen, Nov 12 2017: (Start)
a(n) = A000005(n) - A056595(n).
a(n) = 1 + A071325(n).
a(n) = 1 + A001222(A293515(n)). (End)
L.g.f.: -log(Product_{k>=1} (1 - x^(k^2))^(1/k^2)) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Jul 30 2018
a(n) = Sum_{d|n} A000005(d) * A008836(n/d). - Torlach Rush, Jan 21 2020
a(n) = A000005(sqrt(A008833(n))). - Amiram Eldar, Jul 07 2020
a(n) = Sum_{d divides n} mu(core(d)^2), where core(n) = A007913(n). - Peter Bala, Jan 24 2024

Extensions

Data section filled up to 125 terms and wrong claim deleted from Crossrefs section by Antti Karttunen, Nov 14 2016

A130317 Smallest number having exactly n triangular divisors.

Original entry on oeis.org

1, 3, 6, 36, 30, 90, 180, 210, 420, 630, 1890, 1260, 2520, 6930, 18480, 20790, 13860, 27720, 41580, 83160, 138600, 245700, 235620, 180180, 556920, 360360, 540540, 1670760, 1081080, 1413720, 2702700, 2162160, 6486480, 3063060, 8288280
Offset: 1

Views

Author

Reinhard Zumkeller, May 23 2007

Keywords

Comments

2*a(n) is smallest number having exactly n oblong divisors.
A007862(a(n)) = n and A007862(m) <> n for m < a(n).

Examples

			a(3)=6: A007862(6)=#{1,2*(2+1)/2,3*(3+1)/2}=3;
a(4)=36: A007862(36)=#{1,2*(2+1)/2,3*(3+1)/2,8*(8+1)/2}=4;
		

Crossrefs

Programs

  • PARI
    a(n) = my(k=1); while (sumdiv(k, d, ispolygonal(d,3)) != n, k++); k; \\ Michel Marcus, Jan 14 2022

Formula

a(n) = A088726(n-1)/2 for n>1. - Ray Chandler, Jun 24 2008

Extensions

Extended by Ray Chandler, Jun 24 2008

A122375 Number of distinct prime factors of the smallest number with exactly n divisors.

Original entry on oeis.org

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

Views

Author

Lekraj Beedassy, Aug 30 2006

Keywords

Comments

a(n) = 1 iff n is prime.

Examples

			a(14) = 2 as A005179(14) = 192 which has 2 distinct prime divisors (2 and 3). - _David A. Corneth_, Dec 10 2021
		

Crossrefs

Programs

Formula

a(n) = omega(A005179(n)), where omega(n) = A001221(n).
a(n) = A001221(A130279(n)). - Reinhard Zumkeller, May 21 2007

Extensions

Edited and extended by Ray Chandler, Sep 11 2006

A122376 Number of prime factors (counted with multiplicity) of the smallest number with exactly n divisors.

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 6, 4, 4, 5, 10, 4, 12, 7, 6, 5, 16, 5, 18, 6, 8, 11, 22, 6, 8, 13, 6, 8, 28, 7, 30, 6, 12, 17, 10, 6, 36, 19, 14, 7, 40, 9, 42, 12, 8, 23, 46, 7, 12, 9, 18, 14, 52, 7, 14, 9, 20, 29, 58, 8, 60, 31, 10, 8, 16, 13, 66, 18, 24, 11, 70, 9, 72, 37, 10, 20, 16, 15, 78, 9, 8, 41
Offset: 1

Views

Author

Lekraj Beedassy, Aug 30 2006

Keywords

Comments

This function is not additive; the smallest counterexample is a(40) = 7 != 4 + 4 = a(5) + a(8). - Franklin T. Adams-Watters Jul 10 2009

Crossrefs

Programs

  • Mathematica
    s = { (* terms in A005179 *) }; f[n_] := Plus @@ Last /@ FactorInteger@n; f /@ s (* Robert G. Wilson v, Aug 31 2006 *)

Formula

a(n) = Omega(A005179(n)), where Omega(n) = A001222(n).
a(p) = p-1 for prime p.
a(n) = A001222(A130279(n))/2. - Reinhard Zumkeller, May 21 2007

Extensions

More terms from Robert G. Wilson v, Aug 31 2006
Edited and extended by Ray Chandler, Sep 11 2006
Incorrect comment removed by Franklin T. Adams-Watters, Jul 11 2009

A357450 a(n) is the smallest integer having exactly n odd square divisors (A298735).

Original entry on oeis.org

1, 9, 81, 225, 6561, 2025, 531441, 11025, 50625, 164025, 3486784401, 99225, 282429536481, 13286025, 4100625, 893025, 1853020188851841, 2480625, 150094635296999121, 8037225, 332150625, 87169610025, 984770902183611232881, 12006225, 2562890625, 7060738412025, 121550625
Offset: 1

Views

Author

Bernard Schott, Sep 29 2022

Keywords

Comments

All terms are odd and squares (A016754).

Examples

			2025 has 6 divisors that are odd squares: {1, 9, 25, 81, 225, 2025}; also, 2025 is the smallest integer that has 6 odd squares divisors, hence a(6) = 2025.
		

Crossrefs

Programs

  • PARI
    f(n) = factorback(apply(e->e\2+1, factor(n/2^valuation(n, 2))[, 2])); \\ A298735
    a(n) = my(k=1); while (f(k)!=n, k++); k; \\ Michel Marcus, Sep 29 2022

Formula

a(n) = A038547(n)^2. - Thomas Scheuerle, Sep 30 2022
Proof: Suppose a(n) = Product p_i^(2*e_i), where the p_i are odd primes. Then the n odd square divisors are all of the form d = Product p_i^(2*k_i) with 0 <= k_i <= e_i. As a(n) = Product (p_i^e_i)^2 = (Product (p_i^e_i))^2, we get that sqrt(a(n)) = Product (p_i^e_i). This is the prime decomposition of sqrt(a(n)). As there is a bijection between prime factors p_i^(2*k_i) and (p_i^k_i), there is also bijection between odd square divisors of a(n) and odd divisors of sqrt(a(n)). We conclude that sqrt(a(n)) is the smallest integer that has exactly n odd divisors. - Bernard Schott, Oct 01 2022
a(p) = 3^(2*(p-1)) for primes p. - Bernard Schott, Oct 03 2022

Extensions

a(7)-a(10) from Michel Marcus, Sep 29 2022
More terms from Amiram Eldar, Sep 29 2022

A358252 a(n) is the least number with exactly n non-unitary square divisors.

Original entry on oeis.org

1, 8, 32, 128, 288, 864, 1152, 2592, 4608, 13824, 10368, 20736, 28800, 41472, 64800, 279936, 115200, 331776, 345600, 663552, 259200, 1679616, 518400, 1620000, 1166400, 4860000, 1036800, 17915904, 2073600, 15552000, 6998400, 26873856, 4147200, 53747712, 8294400
Offset: 0

Views

Author

Amiram Eldar, Nov 05 2022

Keywords

Comments

a(n) is the least number k such that A056626(k) = n.
Since A056626(k) depends only on the prime signature of k, all the terms of this sequence are in A025487.

Examples

			a(1) = 8 since 8 is the least number that has exactly one non-unitary square divisor, 4.
		

Crossrefs

Similar sequences: A005179 (all divisors), A038547 (odd divisors), A085629 (coreful divisors), A130279 (square), A187941 (even), A309181 (non-unitary), A340232 (bi-unitary), A340233 (exponential), A357450 (odd square).

Programs

  • Mathematica
    f1[p_, e_] := 1 + Floor[e/2]; f2[p_, e_] := 2^(1 - Mod[e, 2]); f[1] = 0; f[n_] := Times @@ f1 @@@ (fct = FactorInteger[n]) - Times @@ f2 @@@ fct; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n] + 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[21, 10^6]
  • PARI
    s(n) = {my(f = factor(n)); prod(i = 1, #f~, 1 + floor(f[i,2]/2)) - 2^sum(i = 1, #f~, 1 - f[i,2]%2);}
    lista(len, nmax) = {my(v = vector(len), c = 0, n = 1, i); while(c < len && n < nmax, i = s(n) + 1; if(i <= len && v[i] == 0, c++; v[i] = n); n++); v};

A358543 a(n) is the smallest number with exactly n divisors that are square pyramidal numbers.

Original entry on oeis.org

1, 5, 30, 140, 420, 1540, 4620, 13860, 78540, 157080, 471240, 1141140, 3603600, 3423420, 13693680, 30630600, 58198140, 116396280, 214414200, 428828400, 581981400, 1163962800, 5354228880, 4073869800, 8147739600, 26771144400, 36082846800, 80313433200, 93699005400, 187398010800
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 21 2022

Keywords

Comments

Any terms for n > 25 exceed 10^10. - Lucas A. Brown, Dec 24 2022
a(25) <= 8147739600, a(26) <= 26771144400, a(27) <= 36082846800, a(28) <= 80313433200. - Jon E. Schoenfield, Dec 16 2022

Examples

			a(3) = 30 because 30 has 3 square pyramidal divisors {1, 5, 30} and this is the smallest such number.
		

Crossrefs

Programs

  • PARI
    issqpyr(n) = my(m = sqrtnint(3*n, 3)); n==m*(m+1)*(2*m+1)/6; \\ A253903
    a(n) = my(k=1); while (sumdiv(k, d, issqpyr(d)) != n, k++); k; \\ Michel Marcus, Nov 21 2022

Extensions

a(15) from Michel Marcus, Nov 21 2022
a(16)-a(20) from Jinyuan Wang, Nov 28 2022
a(21)-a(22) from Lucas A. Brown, Dec 14 2022
a(23)-a(24) from Lucas A. Brown, Dec 18 2022
a(25) from Lucas A. Brown, Dec 22 2022
a(26)-a(30) from Bert Dobbelaere, May 18 2025

A358545 a(n) is the smallest number with exactly n divisors that are centered square numbers.

Original entry on oeis.org

1, 5, 25, 325, 1625, 1105, 5525, 27625, 160225, 1022125, 801125, 5928325, 8491925, 29641625, 42459625, 444215525, 314201225, 2003613625, 1571006125, 14826740825, 12882250225, 127081657625, 64411251125, 88717383625
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 21 2022

Keywords

Comments

Any subsequent terms are > 10^10. - Lucas A. Brown, Dec 24 2022

Examples

			a(3) = 25 because 25 has 3 centered square divisors {1, 5, 25} and this is the smallest such number.
		

Crossrefs

Programs

  • PARI
    iscsq(n) = issquare(2*n-1); \\ A001844
    a(n) = my(k=1); while (sumdiv(k, d, iscsq(d)) != n, k++); k; \\ Michel Marcus, Nov 21 2022

Extensions

a(12)-a(15) from Michel Marcus, Nov 21 2022
a(16) from Martin Ehrenstein, Dec 02 2022
a(17)-a(24) from Jinyuan Wang, Dec 02 2022

A353282 a(n) is the number of solutions (x,y) to the Diophantine equation S(x,y) = (x+y) + (x-y) + (x*y) + (x/y) = A013929(n) when x >= y > 1 and y | x.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 3, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 3, 3, 1, 3, 1, 1, 2, 1, 3, 1, 2, 3, 1
Offset: 1

Views

Author

Bernard Schott, Apr 09 2022

Keywords

Comments

This is the generalization of a problem proposed by Yakov Perelman for A013929(93) = 243 (references, links and example).
a(n) is the number of squares > 1 dividing A013929(n), so, there is no solution (x,y) for S(x,y) = m when m is a squarefree number (A005117).
Also, number of times where A013929(n) appears in table A351381.
The smallest nonsquare number m such that equation S(x,y) = m has exactly n solutions, for n >= 0, is A130279(n+1).
Integers k for which number of solutions to the equation S(x,y) = k sets a new record are in A046952.

Examples

			For S(x,y) = (x+y) + (x-y) + (x*y) + (x/y) = A013929(2) = 8, the unique solution is (2,1) because (2+1) + (2-1) + (2*1) + (2/1) = 8, hence a(2) = 1.
For S(x,y) = A013929(93) = 243, the two solutions are (24,8) and (54,2) because S(24,8) = S(54,2) = 243, hence a(93) = 2 (problem from Perelman's book).
		

References

  • I. Perelman, L'Algèbre récréative, Deux nombres et quatre opérations, Editions en langues étrangères, Moscou, 1959, pp. 101-102.
  • Ya. I. Perelman, Algebra can be fun, Two numbers and four operations, Mir Publishers Moscow, 1979, pp. 131-132.

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := 1 + Floor[e/2]; s[1] = 0; s[n_] := Times @@ (f @@@ FactorInteger[n]) - 1; s /@ Select[Range[250], ! SquareFreeQ[#] &] (* Amiram Eldar, Apr 09 2022 *)

Formula

a(n) = A046951(A013929(n)) - 1.

Extensions

More terms from Amiram Eldar, Apr 09 2022

A358262 a(n) is the least number with exactly n noninfinitary square divisors.

Original entry on oeis.org

1, 16, 144, 256, 3600, 1296, 2304, 65536, 129600, 16777216, 32400, 20736, 57600, 331776, 589824, 4294967296, 6350400, 1099511627776, 150994944, 810000, 1587600, 1679616, 518400, 5308416, 2822400, 84934656, 8294400, 26873856, 14745600, 21743271936, 38654705664
Offset: 0

Views

Author

Amiram Eldar, Nov 06 2022

Keywords

Comments

a(n) is the least number k such that A358261(k) = n.
Since A358261(k) depends only on the prime signature of k, all the terms of this sequence are in A025487.

Examples

			a(1) = 16 since 16 is the least number with exactly one noninfinitary divisor, 4.
		

Crossrefs

Similar sequences: A005179 (all divisors), A038547 (odd divisors), A085629 (coreful divisors), A130279 (square), A187941 (even), A309181 (non-unitary), A340232 (bi-unitary), A340233 (exponential), A357450 (odd square), A358252 (non-unitary square).

Programs

  • Mathematica
    f1[p_, e_] := 1 + Floor[e/2]; f2[p_, e_] := 2^DigitCount[If[OddQ[e], e - 1, e], 2, 1]; f[1] = 0; f[n_] := Times @@ f1 @@@ (fct = FactorInteger[n]) - Times @@ f2 @@@ fct; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n] + 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[15, 2*10^7]
  • PARI
    s(n) = {my(f = factor(n));  prod(i=1, #f~, 1+f[i,2]\2) - prod(i=1, #f~, 2^hammingweight(if(f[i,2]%2, f[i,2]-1, f[i,2])))};
    lista(len, nmax) = {my(v = vector(len), c = 0, n = 1, i); while(c < len && n < nmax, i = s(n) + 1; if(i <= len && v[i] == 0, c++; v[i] = n); n++); v};
Showing 1-10 of 14 results. Next