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

A173720 Sum_{ 4 <= c <= A113646(n) } (n mod c), where c runs over all composites A002808.

Original entry on oeis.org

1, 2, 3, 0, 6, 2, 11, 2, 5, 9, 25, 9, 28, 21, 28, 24, 50, 27, 56, 33, 44, 56, 92, 52, 66, 81, 88, 87, 134, 92, 142, 102, 122, 143, 165, 139, 200, 187, 212, 196, 264, 209, 280, 239, 244, 274, 352, 266, 298, 296, 330, 335, 424, 347, 384, 368, 407, 447, 547, 432, 535, 516, 529, 513, 558
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 26 2010

Keywords

Crossrefs

Programs

  • Maple
    A173720 := proc(n) a := 0 ; for i from 1 do c := A002808(i) ; a := a + (n mod c) ;   if c >= n then return a; end if; end do: end proc:
    seq(A173720(n),n=1..80) ; # R. J. Mathar, Nov 26 2010

A379301 Positive integers whose prime indices include a unique composite number.

Original entry on oeis.org

7, 13, 14, 19, 21, 23, 26, 28, 29, 35, 37, 38, 39, 42, 43, 46, 47, 52, 53, 56, 57, 58, 61, 63, 65, 69, 70, 71, 73, 74, 76, 77, 78, 79, 84, 86, 87, 89, 92, 94, 95, 97, 101, 103, 104, 105, 106, 107, 111, 112, 113, 114, 115, 116, 117, 119, 122, 126, 129, 130, 131
Offset: 1

Views

Author

Gus Wiseman, Dec 25 2024

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The prime indices of 70 are {1,3,4}, so 70 is in the sequence.
The prime indices of 98 are {1,4,4}, so 98 is not in the sequence.
		

Crossrefs

For no composite parts we have A302540, counted by A034891 (strict A036497).
For all composite parts we have A320629, counted by A023895 (strict A204389).
For a unique prime part we have A331915, counted by A379304 (strict A379305).
Positions of one in A379300.
Partitions of this type are counted by A379302 (strict A379303).
A000040 lists the prime numbers, differences A001223.
A002808 lists the composite numbers, nonprimes A018252, differences A073783 or A065310.
A055396 gives least prime index, greatest A061395.
A056239 adds up prime indices, row sums of A112798, counted by A001222.
A066247 is the characteristic function for the composite numbers.
A377033 gives k-th differences of composite numbers, see A073445, A377034-A377037.
Other counts of prime indices:
- A087436 postpositive, see A038550.
- A330944 nonprime, see A002095, A096258, A320628, A330945.
- A379306 squarefree, see A302478, A379308, A379309, A379316.
- A379310 nonsquarefree, see A114374, A256012, A379307.
- A379311 old prime, see A379312-A379315.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],Length[Select[prix[#],CompositeQ]]==1&]

A376198 a(1) = 1, a(2) = 2. Thereafter, let smc and smp denote the smallest missing composite and smallest missing prime. If a(n) is composite, then if a(n) = 2*smp then a(n+1) = smp, otherwise a(n+1) = smc; if a(n) is a prime, then if smp < smc, a(n+1) = smp, otherwise a(n+1) = smc.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 5, 7, 11, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 13, 17, 19, 23, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 29, 31, 37, 41, 43, 47, 53, 59, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Comments

The composite terms appear in their natural order, as do the primes.
This is a simplified version of A375564 (the difference being in the way the composite numbers are handled: here they appear in order, whereas in A375564 successive composite numbers must have a common gcd greater than 1).
The following table was calculated by Michael S. Branicky on Oct 04 2024.
It shows the beginning, end, and length of the k-th run of successive primes.
a b c : d e f [a = k, b = A376750(k), c = A376751(k),
1 2 2 : 3 3 2 d = A376752(k), e = A376753(k), f = A376754(k)]
2 9 5 : 11 11 3
3 23 13 : 26 23 4
4 52 29 : 59 59 8
5 110 61 : 122 113 13
6 231 127 : 254 251 24
7 472 257 : 514 509 43
8 965 521 : 1042 1039 78
9 1958 1049 : 2099 2099 142
10 3962 2111 : 4222 4219 261
11 7980 4229 : 8458 8447 479
12 16029 8461 : 16922 16921 894
13 32181 16927 : 33854 33851 1674
14 64597 33857 : 67714 67709 3118
15 129574 67723 : 135446 135433 5873
16 259798 135449 : 270899 270899 11102
17 520835 270913 : 541826 541817 20992
18 1043833 541831 : 1083662 1083659 39830
19 2091473 1083689 : 2167378 2167369 75906
20 4190135 2167393 : 4334786 4334777 144652
21 8392863 4334791 : 8669582 8669543 276720
22 16809322 8669593 : 17339186 17339177 529865
23 33661860 17339197 : 34678394 34678381 1016535
24 67402676 34678421 : 69356842 69356839 1954167
25 134952624 69356857 : 138713714 138713711 3761091
26 270177158 138713717 : 277427434 277427431 7250277
27 540861852 277427441 : 554854882 554854873 13993031
28 1082667610 554854889 : 1109709778 1109709709 27042169
29 2167106199 1109709791 : 2219419582 2219419577 52313384
30 4337519113 2219419597 : 4438839194 4438839173 101320082
31 8681255531 4438839259 : 8877678518 8877678499 196422988
32 17374202846 8877678527 : 17755357054 17755357051 381154209
33 34770433922 17755357069 : 35510714138 35510714137 740280217

Crossrefs

See also A113646 (next composite number).

Programs

  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        an, smc, smp = 2, 4, 3
        yield from [1, 2]
        while True:
            if not isprime(an):
                an = smp if an == 2*smp else smc
            else:
                an = smp if smp < smc else smc
            if an == smp: smp = nextprime(smp)
            else:
                smc += 1
                while isprime(smc): smc += 1
            yield an
    print(list(islice(agen(), 87))) # Michael S. Branicky, Oct 03 2024

A014683 In the sequence of positive integers add 1 to each prime number.

Original entry on oeis.org

1, 3, 4, 4, 6, 6, 8, 8, 9, 10, 12, 12, 14, 14, 15, 16, 18, 18, 20, 20, 21, 22, 24, 24, 25, 26, 27, 28, 30, 30, 32, 32, 33, 34, 35, 36, 38, 38, 39, 40, 42, 42, 44, 44, 45, 46, 48, 48, 49, 50, 51, 52, 54, 54, 55, 56, 57, 58, 60, 60, 62, 62, 63, 64, 65, 66, 68, 68, 69, 70, 72, 72
Offset: 1

Views

Author

Keywords

Comments

For n >= 3, a(n) = smallest composite number m such that m - (n-2) is a prime. - Amarnath Murthy and Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Mar 08 2003
Möbius transform of sigma(n)+omega(n) = A380457(n). - Wesley Ivan Hurt, Jun 22 2025

Crossrefs

Programs

  • Haskell
    a014683 n = n + a010051' n  -- Reinhard Zumkeller, Nov 01 2014
    
  • Mathematica
    Array[If[PrimeQ[#],#+1,#]&,80] (* Harvey P. Dale, Jul 21 2013 *)
  • PARI
    a(n)=n+isprime(n)
    
  • Python
    from sympy import isprime
    def A014683(n): return n+isprime(n) # Chai Wah Wu, Oct 03 2024

Formula

a(n) = n + pi(n) - pi(n-1). - Wesley Ivan Hurt, Jun 15 2013
a(n) = n + A010051(n). - Reinhard Zumkeller, Nov 01 2014
a(n) = Sum_{d|n} A380457(d)*mu(n/d). - Wesley Ivan Hurt, Jun 22 2025

Extensions

More terms from Erich Friedman.

A379300 Number of prime indices of n that are composite.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 25 2024

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The prime indices of 39 are {2,6}, so a(39) = 1.
The prime indices of 70 are {1,3,4}, so a(70) = 1.
The prime indices of 98 are {1,4,4}, so a(98) = 2.
The prime indices of 294 are {1,2,4,4}, a(294) = 2.
The prime indices of 1911 are {2,4,4,6}, so a(1911) = 3.
The prime indices of 2548 are {1,1,4,4,6}, so a(2548) = 3.
		

Crossrefs

Positions of first appearances are A000420.
Positions of zero are A302540, counted by A034891 (strict A036497).
Positions of one are A379301, counted by A379302 (strict A379303).
A000040 lists the prime numbers, differences A001223.
A002808 lists the composite numbers, nonprimes A018252, differences A073783 or A065310.
A055396 gives least prime index, greatest A061395.
A056239 adds up prime indices, row sums of A112798, counted by A001222.
A066247 is the characteristic function for the composite numbers.
A377033 gives k-th differences of composite numbers, see A073445, A377034-A377037.
Other counts of prime indices:
- A087436 postpositive, see A038550.
- A330944 nonprime, see A002095, A096258, A320628, A330945.
- A379306 squarefree, see A302478, A379308, A379309, A379316.
- A379310 nonsquarefree, see A114374, A256012, A379307.
- A379311 old prime, see A379312-A379315.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[Select[prix[n],CompositeQ]],{n,100}]

Formula

Totally additive with a(prime(k)) = A066247(k).

A326344 a(1) = 1. Thereafter, if n is prime, a(n) is the next prime after a(n-1), but written backwards. If n is not prime, a(n) is the next composite after a(n-1), written backwards.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 4, 5, 6, 8, 9, 11, 21, 32, 33, 43, 44, 74, 57, 85, 68, 96, 89, 79, 8, 11, 21, 22, 42, 44, 54, 95, 69, 7, 8, 11, 21, 32, 33, 43, 44, 74, 57, 85, 68, 96, 89, 79, 8, 9, 1, 4, 6, 7, 8, 11, 21, 22, 42, 44, 54, 95, 69, 7, 8, 11, 21
Offset: 1

Views

Author

Max Tohline, Sep 11 2019

Keywords

Comments

The first two-digit a(n) occurs at n = 17. The first three-digit a(n) occurs at n = 643. According to Michel Marcus, in the first 10^8 terms, a(n) never exceeds 909. It is now known that this is the maximal value (see the Weimholt link).
Since prime gaps (A001223) do not become periodic, this sequence should not become periodic either, though several short series of terms (e.g., 11, 21, 22, 42, 44, 54, 95, 69) reappear frequently.
From Rémy Sigrist, Sep 12 2019: (Start)
For any n > 0:
- let c(n) be the next composite after n, read backwards,
- let p(n) be the next prime after n, read backwards.
Let C be the set defined by the following rules:
- 2 belongs to C,
- if x belongs to C, then c(c(x)) and c(p(x)) also belong to C.
We can prove by program that the set C is finite.
Hence:
- for any even number n >= 2, a(n) <= max(C) = 939,
- for any odd number n >= 3, a(n) <= max({c(k), k in C} U {p(k), k in C}) = 938.
Hence the sequence is bounded, and A326298 and A326402 are finite.
(End)
From M. F. Hasler, Sep 13 2019: (Start)
Terms a(n) > 800 occur at indices (649, 3132, [3595], 3596, [6805], 6806, 7344, 8233, [8234], [11173], 11174, 12619, 13687, 14089, ...). (Subsequent indices are > 20000. Indices in [.] correspond to a non-maximal value, i.e., a(n+-1) > a(n).) The corresponding values are in the set {804, 806, 807, 808, 809, 904, 907} and occur as part of one of the following subsequences: (maxima starred)
a) (..., 66, 86, 98, 99, 101, 201, 202, 302, 703, 407, 804*, 508, 15, 61, 26, ...)
b) (..., 66, 86, 98, 99, 101, 201, 202, 302, 303, 403, 904*, 509, 15, 61, ...)
c) (..., 201, 202, 302, 303, 403, 404, 504, 505, 605, 606, 806*, 708, 17, 81, 28, 92, 39, ...)
d) (..., 302, 303, 403, 404, 504, 505, 605, 706, 707, 807, 808*, 18, 2, 4, 6, 8, 9, 1, 4, ...),
e) (..., 302, 303, 403, 404, 504, 505, 605, 706, 707, 907*, 809, 18, 2, 3, 4, 6, 8, 9, 1, ...).
(End)

Crossrefs

For records see A326298 and A326402.
Cf. A000027 (the positive integers: this sequence without the digit-reversal, as observed by Michel Marcus).
For analogs in bases 3, 6, and 7 see A326894, A327463, and A327241.
For analogs in bases 3,5,6,7,10 see A326894, A327464, A327463, A327241, A326344 = the present sequence.

Programs

  • Maple
    c:= n-> (k-> `if`(isprime(k), c(k), k))(n+1):
    a:= proc(n) option remember; `if`(n=1, 1,
          (s-> parse(cat(s[-i]$i=1..length(s))))(""||(
          `if`(isprime(n), nextprime(a(n-1)), c(a(n-1))))))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 12 2019
  • Mathematica
    ncp[{n_,a_}]:=Module[{k=1},{n+1,If[PrimeQ[n+1],IntegerReverse[NextPrime[ a]],While[!CompositeQ[k+a],k++];IntegerReverse[k+a]]}]; NestList[ncp,{1,1},80][[All,2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 05 2020 *)
  • PARI
    nextcompo(n) = while(isprime(n), n++); n;
    lista(nn) = {my(a = 1); for (n=2, nn, print1(a, ", "); if (isprime(n), a = nextprime(a+1), a = nextcompo(a+1)); a = fromdigits(Vecrev(digits(a))););} \\ Michel Marcus, Sep 11 2019
    
  • PARI
    A326344_vec(N) = vector(N,n,N=A004086(if(n<=9,n,isprime(n),nextprime(N+1),N>3,N+2^isprime(N+1),4))) \\ Next composite is N+1 if this is composite, else N+2 (unless N=1). A004086(n)=fromdigits(Vecrev(digits(n))). - M. F. Hasler, Sep 13 2019

A378371 Distance between n and the least non prime power >= n, allowing 1.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 28 2024

Keywords

Comments

Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...

Examples

			The least non prime power >= 4 is 6, so a(4) = 2.
		

Crossrefs

Sequences obtained by adding n to each term are placed in parentheses below.
For prime we have A007920 (A151800), strict A013632.
For composite we have A010051 (A113646 except initial terms).
For perfect power we have A074984 (A377468)
For squarefree we have A081221 (A067535).
For nonsquarefree we have (A120327).
For non perfect power we have A378357 (A378358).
The opposite version is A378366 (A378367).
For prime power we have A378370, strict A377282 (A000015).
This sequence is A378371 (A378372).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n,PrimePowerQ[#]&]-n,{n,100}]

Formula

a(n) = A378372(n) - n.

A378372 Least non prime power >= n, allowing 1.

Original entry on oeis.org

1, 6, 6, 6, 6, 6, 10, 10, 10, 10, 12, 12, 14, 14, 15, 18, 18, 18, 20, 20, 21, 22, 24, 24, 26, 26, 28, 28, 30, 30, 33, 33, 33, 34, 35, 36, 38, 38, 39, 40, 42, 42, 44, 44, 45, 46, 48, 48, 50, 50, 51, 52, 54, 54, 55, 56, 57, 58, 60, 60, 62, 62, 63, 65, 65, 66, 68
Offset: 1

Views

Author

Gus Wiseman, Nov 29 2024

Keywords

Comments

Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...

Examples

			The least non prime power >= 4 is 6, so a(4) = 6.
		

Crossrefs

Sequences obtained by subtracting n from each term are placed in parentheses below.
For prime power we have A000015 (A378370).
For squarefree we have A067535 (A081221).
For composite we have A113646 (A010051).
For nonsquarefree we have A120327.
For prime we have A151800 (A007920), strict (A013632).
Run-lengths are 1 and A375708.
For perfect power we have A377468 (A074984).
For non-perfect power we have A378358 (A378357).
The opposite is A378367, distance A378366.
This sequence is A378372 (A378371).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n,PrimePowerQ[#]&],{n,100}]

Formula

a(n) = A378371(n) + n.

A179278 Largest nonprime integer <= n.

Original entry on oeis.org

1, 1, 1, 4, 4, 6, 6, 8, 9, 10, 10, 12, 12, 14, 15, 16, 16, 18, 18, 20, 21, 22, 22, 24, 25, 26, 27, 28, 28, 30, 30, 32, 33, 34, 35, 36, 36, 38, 39, 40, 40, 42, 42, 44, 45, 46, 46, 48, 49, 50, 51, 52, 52, 54, 55, 56, 57, 58, 58, 60, 60, 62, 63, 64, 65, 66, 66, 68, 69, 70, 70, 72
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 08 2010

Keywords

Examples

			From _Gus Wiseman_, Dec 04 2024: (Start)
The nonprime integers <= n:
  1  1  1  4  4  6  6  8  9  10  10  12  12  14  15  16
           1  1  4  4  6  8  9   9   10  10  12  14  15
                 1  1  4  6  8   8   9   9   10  12  14
                       1  4  6   6   8   8   9   10  12
                          1  4   4   6   6   8   9   10
                             1   1   4   4   6   8   9
                                     1   1   4   6   8
                                             1   4   6
                                                 1   4
                                                     1
(End)
		

Crossrefs

For prime we have A007917.
For nonprime we have A179278 (this).
For squarefree we have A070321.
For nonsquarefree we have A378033.
For prime power we have A031218.
For non prime power we have A378367.
For perfect power we have A081676.
For non perfect power we have A378363.
A000040 lists the primes, differences A001223.
A002808 lists the composite numbers, differences A073783.
A018252 lists the nonprimes, differences A065310.
A095195 has row n equal to the k-th differences of the prime numbers.
A113646 gives least nonprime >= n.
A151800 gives the least prime > n, weak version A007918.
A377033 has row n equal to the k-th differences of the composite numbers.

Programs

  • Mathematica
    Array[# - Boole[PrimeQ@ #] - Boole[# == 3] &, 72] (* Michael De Vlieger, Oct 13 2018 *)
    Table[Max@@Select[Range[n],!PrimeQ[#]&],{n,30}] (* Gus Wiseman, Dec 04 2024 *)
  • PARI
    a(n) = if (isprime(n), if (n==3, 1, n-1), n); \\ Michel Marcus, Oct 13 2018

Formula

For n > 3: a(n) = A113523(n) = A014684(n);
For n > 0: a(n) = A113638(n). - Georg Fischer, Oct 12 2018
A005171(a(n)) = 1; A010051(a(n)) = 0.
a(n) = A018252(A062298(n)). - Ridouane Oudra, Aug 22 2025

Extensions

Inequality in the name reversed by Gus Wiseman, Dec 05 2024

A378357 Distance from n to the least non perfect power >= n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 24 2024

Keywords

Comments

Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916.
All terms are <= 2 because the only adjacent perfect powers are 8 and 9.

Crossrefs

The version for prime numbers is A007920, subtraction of A159477 or A007918.
The version for perfect powers is A074984, subtraction of A377468.
The version for squarefree numbers is A081221, subtraction of A067535.
Subtracting from n gives A378358, opposite A378363.
The opposite version is A378364.
The version for nonsquarefree numbers is A378369, subtraction of A120327.
The version for prime powers is A378370, subtraction of A000015.
The version for non prime powers is A378371, subtraction of A378372.
The version for composite numbers is A378456, subtraction of A113646.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289, seconds A376559.
A007916 lists the non perfect powers, differences A375706, seconds A376562.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A377432 counts perfect powers between primes, zeros A377436.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[NestWhile[#+1&,n,#>1&&perpowQ[#]&]-n,{n,100}]
  • Python
    from sympy import perfect_power
    def A378357(n): return 0 if n>1 and perfect_power(n)==False else 1 if perfect_power(n+1)==False else 2 # Chai Wah Wu, Nov 27 2024

Formula

a(n) = n - A378358(n).
Showing 1-10 of 18 results. Next