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.

User: Devansh Singh

Devansh Singh's wiki page.

Devansh Singh has authored 14 sequences. Here are the ten most recent ones:

A350878 Integers m that divide the sum of values d*p < m, where d is a divisor of m, p is a prime, and d*p does not divide m.

Original entry on oeis.org

1, 2, 5, 10, 18, 24, 32, 60, 71, 100, 512, 2990, 9910, 10031, 12618, 32674, 53586, 153878, 223500, 312608, 369119, 386110, 466569, 4491817, 7068356, 8765871, 65311881
Offset: 1

Author

Devansh Singh, Jan 20 2022

Keywords

Comments

Conjecture: The sum of values d*p < m in the definition of the sequence is equal to m for m = 5 only. True for m <= 15000.
A007506 is the subsequence of the prime terms of this sequence. - Amiram Eldar, Jan 20 2022
a(28) > 10^8. - David A. Corneth, Jan 21 2022

Crossrefs

Programs

  • Mathematica
    q[n_] := Module[{ds = Divisors[n], s = 0, r}, Do[r = n/d; ps = Select[Range[2, r], PrimeQ[#] && ! Divisible[n, d*#] &]; s += Total[d*ps], {d, ds}]; Divisible[s, n]]; Select[Range[3000], q] (* Amiram Eldar, Jan 20 2022 *)
  • PARI
    isok(m) = {my(d=divisors(m), s=0); forprime(p=2, m, for(k=1, #d, my(x=d[k]*p); if ((x < m) && (m % x), s+=x););); (s % m) == 0;} \\ Michel Marcus, Jan 21 2022
    
  • PARI
    \\ See Corneth link \\ David A. Corneth, Jan 21 2022
  • Python
    import sympy
    A350878=[]
    for m in range(1,15001):
        sum=0
        primes_lessthan_m_by2 = list(sympy.primerange(2,-(m//-2)))
        primes_between_m_by2_and_m = list(sympy.primerange(m//2+1,m))
        divisors_of_m=sympy.divisors(m,generator=False)
        divisors_of_m.remove(m)
        if m%2==0:
            divisors_of_m.remove(m//2)
        for p in primes_between_m_by2_and_m:
            sum+=p
        for p in primes_lessthan_m_by2:
            for d in divisors_of_m:
                if p< m//d and m%(d*p)!=0:
                    sum+=d*p
        if sum%m==0:
           A350878.append(m)
    print(A350878)
    

Extensions

a(16)-a(20) from Amiram Eldar, Jan 21 2022
a(21)-a(27) from David A. Corneth, Jan 21 2022

A350046 Numbers m such that, in the prime factorization of m! (with the primes in ascending order), no two successive exponents differ by a composite number.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 15, 32, 35, 162, 163
Offset: 1

Author

Devansh Singh, Dec 11 2021

Keywords

Comments

Is this sequence finite?
After 163, there are no more terms through 10^10. - Jon E. Schoenfield, Dec 15 2021
Sequence is the same as numbers m such that, in the prime factorization of m! (with the exponents in ascending order), no two successive exponents differ by a composite number. This is due to the fact that in the factorization of m! with the primes in ascending order, the corresponding exponents are in descending order. - Chai Wah Wu, Jan 10 2022

Examples

			15! = 2^11 * 3^6 * 5^3 * 7^2 * 11^1 * 13^1; the exponents are 11, 6, 3, 2, 1, 1, and no two successive/neighboring exponents differ by a composite number, so 15 is a term of the sequence.
		

Crossrefs

Programs

  • Mathematica
    q[n_] := AllTrue[Differences @ Reverse[FactorInteger[n!][[;; , 2]]], !CompositeQ[#] &]; Select[Range[2, 200], q] (* Amiram Eldar, Dec 11 2021 *)
  • PARI
    valp(n,p)=my(s); while(n\=p, s+=n); s
    is(n)=my(o=valp(n,2),e); forprime(p=3,, e=valp(n,p); if(o-e<4, return(1)); if(isprime(o-e), o=e, return(0))) \\ Charles R Greathouse IV, Dec 15 2021
  • Python
    import sympy
    def last_exponent(c,i):
        if sympy.nextprime(i//2)<=i:
            if c==1 or sympy.isprime(c-1):
                return(True)
            else: return(False)
        else:
            if c==1 or sympy.isprime(c):
                return(True)
            else: return(False)
    A350046_n=[2,3]
    for i in range(4,1001):
        p_expo=True
        x = list(sympy.primerange(2,i//2+1))
        prime_expo=[]
        for j in (x):
            c=i//j
            s=0
            while c!=0:
                s=s+c
                c=c//j
            prime_expo.append(s)
        c=prime_expo[0]
        l=len(prime_expo)
        for j in range(1,l):
            c=c-prime_expo[j]
            if c!=0:
                if c!=1 and not sympy.isprime(c):
                    p_expo=False
                    break
            c=prime_expo[j]
        prime_expo=last_exponent(c,i)
        if p_expo==True:
           A350046_n.append(i)
    print(A350046_n)
    
  • Python
    from collections import Counter
    from itertools import count, islice
    from sympy import factorint, isprime
    def A350046_gen(): # generator of terms
        f = Counter()
        for m in count(2):
            f += Counter(factorint(m))
            e = sorted(f.items())
            if all(d <= 1 or isprime(d) for d in (abs(e[i+1][1]-e[i][1]) for i in range(len(e)-1))):
                yield m
    A350046_list = list(islice(A350046_gen(),15)) # Chai Wah Wu, Jan 10 2022
    

A343541 For n > 1, a(n) is the largest base b <= prime(n)-1 such that the digits of prime(n)-1 in base b contain the digit b-1.

Original entry on oeis.org

2, 2, 3, 2, 4, 3, 3, 5, 4, 6, 2, 2, 7, 7, 4, 8, 8, 6, 6, 9, 9, 2, 3, 10, 5, 6, 6, 5, 11, 8, 3, 12, 12, 5, 3, 13, 13, 13, 5, 6, 6, 14, 14, 10, 10, 15, 15, 5, 5, 11, 11, 16, 16, 2, 3, 4, 5, 17, 17, 17, 10, 18, 18, 18, 18, 13, 13, 19, 19, 19
Offset: 2

Author

Devansh Singh, Apr 18 2021

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,b,L;
        p:= ithprime(n);
        for b from floor((1 + sqrt(4*p - 3))/2) by -1 do
          L:= convert(p-1,base,b);
          if member(b-1,L) then return b fi
        od;
    end proc:
    map(f, [$2 .. 100]); # Robert Israel, Dec 10 2024
  • Mathematica
    Table[Max@Select[Range[2,Prime@n-1],MemberQ[IntegerDigits[Prime@n-1,#],#-1]&],{n,2,71}] (* Giorgos Kalogeropoulos, Nov 22 2021 *)
  • PARI
    a(n) = my(q=prime(n)-1); forstep(b=q, 2, -1, if (vecmax(digits(q, b)) == b-1, return (b))); \\ Michel Marcus, Apr 19 2021
  • Python
    import sympy
    def a_n(N):
        a_n=[2]
        for i in sympy.primerange(5, N+1):
            a_n.append(A338295(i-1))
        print(a_n)
    def A338295(n):
        checker=0
        for b in range(n//2, 1,-1):
            checker=main_base_check(n, b)
            if checker!=0:
                break
        return checker
    def main_base_check(m, b):
        while m!=0:
            if m%b == b-1:
                return b
            m = m//b
        return 0
    a_n(500)
    

Formula

a(n) <= (1 + sqrt(4*prime(n) - 3))/2 for all n. Prime(n), which is 111 in some base Q, has a(n) = Q+1. Example: 31 = 6*5 + 1 and it is 111 in base 5. - Devansh Singh, Nov 22 2021

A342679 Number of steps for n to reach 1 or n by repeated application of A037916, or -1 if they are never reached.

Original entry on oeis.org

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

Author

Devansh Singh, Mar 18 2021

Keywords

Comments

Let n = (p1^a1)*(p2^a2)*...*(pk^aj) be the prime-factorization of n >= 2, where primes are in ascending order and ai >= 1 for all i >= 1 and <= k, then form n' = a1 a2 a3 ... ak = A037916(n), the concatenation of the exponents. Repeat this process if n' != 1 and != n, otherwise stop.
When n is prime, a(n) = 1; when n is semiprime, a(n) = 2.
Does every n reach 1 by this process, or does there exist some n whose trajectory enters a cycle, i.e., we reach n again instead of 1?
No cycles for n <= 10^9. - Michael S. Branicky, Mar 21 2021

Examples

			3 = 3^1 -> 1, so a(3) = 1;
6 = 2^1 * 3^1 -> 11 = 11^1 -> 1, so a(6) = 2;
16 = 2^4 -> 4 = 2^2 -> 2 = 2^1 -> 1, so a(16) = 3;
50 = 2^1 * 5^2 -> 12 = 2^2 * 3^1 -> 21 = 3^1 * 7^1 -> 11 -> 1, so a(50) = 4.
		

Crossrefs

Programs

  • Mathematica
    Table[Length@Rest@Most@FixedPointList[FromDigits[Last/@FactorInteger@#]&,k],{k,2,100}] (* Giorgos Kalogeropoulos, Apr 01 2021 *)
  • PARI
    f(n) = my(f=factor(n)[,2], s=""); for(i=1, #f~, s=concat(s,Str(f[i]))); eval(s); \\ A037916
    a(n) = my(k=n, nb=0); while (k != 1, k = f(k); nb++); nb; \\ Michel Marcus, Mar 18 2021
  • Python
    import sympy
    N=int(input())
    A342679_n=[]
    for n in range(2,N+1):
        n_0=n
        steps=0
        while not sympy.isprime(n) :
            exponents=list(sympy.factorint(n).values())
            m=""
            for i in exponents:
                m=m+str(i)
            n=int(m)
            if n==n_0:
                break
            steps+=1
        A342679_n.append(steps+1)
    print(A342679_n)
    
  • Python
    def a(n):
      c, iter = 1, A037916(n)
      while iter != 1 and iter != n: c, iter = c+1, A037916(iter)
      return c
    print([a(n) for n in range(2, 89)]) # Michael S. Branicky, Mar 20 2021
    

A340287 Numbers k for which there are A000005(k+1)-1 bases b such that k in base b contains digit b-1.

Original entry on oeis.org

1, 3, 5, 9, 11, 17, 27, 35, 37, 39, 41, 65, 81, 83, 85, 89, 131, 149, 179, 203, 255, 257, 263, 407, 419, 455, 539, 739, 811, 899, 1031, 1109, 1385, 1619, 1631, 1883, 2819, 3299, 3527, 4133, 4139, 4151, 4919, 5669, 5939, 6299, 7055, 7307, 8303, 9829, 9839, 10661
Offset: 1

Author

Devansh Singh, Jan 03 2021

Keywords

Comments

If k written in some base b has b-1 as its least significant digit, then b is a divisor of k+1 (because k = high*b + b-1 means k+1 = b*(high+1)). The present sequence is those k where such divisors are in fact the only bases b where digit b-1 occurs.
In terms of the count of bases in A337496, the divisors give a lower bound A337496(k) >= tau(k+1)-1 (number of divisors except 1). The present sequence is those k at this lower bound.
There are 147 terms to k <= 10^8.

Examples

			1 is a term because A000005(1+1)-1 = 1 such that 1 in base 2 (2|2) contains digit 1 and there are no such bases of 1 which are non-divisors of 1+1.
5 is a term because A000005(5+1)-1 = 3 such that 5 in base 2,3,6 (2|6,3|6 and 6|6) contains digit 1,2,5 respectively and there are no such bases of 5 which are non-divisors of 5+1.
		

Crossrefs

Programs

  • Mathematica
    baseQ[n_, b_] := MemberQ[IntegerDigits[n, b], b - 1]; q[n_] := Count[Range[2, n + 1], ?(baseQ[n, #] &)] == DivisorSigma[0, n + 1] - 1; Select[Range[1000], q] (* _Amiram Eldar, Jan 03 2021 *)
  • PARI
    isok(k) = sum(b=2, k+1, (#select(x->(x==(b-1)), digits(k, b)))>0) == numdiv(k+1)-1; \\ Michel Marcus, Jan 03 2021
  • Python
    def is_n_with_no_nondivisor_baseb(N):
        return list(filter(n_with_no_nondivisor_baseb,range(1,N+1,2)))
    def n_with_no_nondivisor_baseb(n):
        main_base_counter=0
        for b in range(3,((n+1)//2) +1):
            if (n+1)%b!=0:
                main_base_counter=main_base_check(n//b,b)+main_base_counter
                if main_base_counter==1:
                    break
        return main_base_counter==0
    def main_base_check(m,b):
        while m!=0:
            if m%b == b-1:
                return 1
            m = m//b
        if m==0:
            return 0
    print(is_n_with_no_nondivisor_baseb(int(input())))
    

A337162 Numbers m such that Sum_{d|m: 1<=d<=sqrt(m)} m/d-d is a multiple of m.

Original entry on oeis.org

1, 6, 840, 3420
Offset: 1

Author

Devansh Singh, Jan 28 2021

Keywords

Comments

Integers m such that A079667(m) is a multiple of m.
Sum_{d|m: 1<=d<=sqrt(m)} (m/d)-d = 0 only when m=1 and Sum_{d|m: 1<=d<=sqrt(m)} (m/d)-d = m only when m=6.
If m is q+1-perfect and 2*Sum_{d|m: 1<=d<=sqrt(m)} d=m then Sum_{d|m: 1<=d<=sqrt(m)} (m/d)-d = m*q or if m is member of this sequence i.e. Sum_{d|m: 1<=d<=sqrt(m)} (m/d)-d = m*q and 2*Sum_{d|m: 1<=d<=sqrt(m)} d=m then m is q+1-perfect.
Does there exist any m apart from 6 which is q+1-perfect, q>=2 and satisfies 2*Sum_{d|m: 1<=d<=sqrt(m)} d=m? Because if it exists then m is member of this sequence.

Crossrefs

Cf. A079667, A007691 (in comment).

Programs

  • Mathematica
    Select[Range[10^5], Function[m, Mod[DivisorSum[m, Abs[m/# - #] &, # <= Sqrt[m] &], m] == 0]] (* Michael De Vlieger, Mar 17 2021 *)
  • PARI
    isok(m) = !(sumdiv(m, d, if (d^2 <= m, m/d-d)) % m); \\ Michel Marcus, Jan 28 2021

A338420 Numbers k having exactly one base b which is not a divisor of k+1, and k contains the digit b-1 in base b.

Original entry on oeis.org

2, 4, 7, 8, 10, 13, 15, 19, 23, 25, 26, 29, 31, 36, 38, 40, 51, 53, 55, 59, 63, 71, 80, 82, 84, 86, 87, 99, 101, 107, 109, 119, 127, 128, 129, 137, 143, 151, 152, 155, 161, 167, 169, 209, 215, 227, 256, 259, 260, 261, 265, 266, 267, 269, 271
Offset: 1

Author

Devansh Singh, Oct 25 2020

Keywords

Comments

All the terms of A337536 are in this sequence except A337536(2)=3.
There are only 30 terms which are even up to n=124705.

Crossrefs

Cf. A337536.

Programs

A333970 Irregular triangle read by rows where the n-th row lists the bases 2<=b<=n+1 where n in base b contains the digit b-1.

Original entry on oeis.org

2, 2, 3, 2, 4, 2, 5, 2, 3, 6, 2, 3, 7, 2, 3, 4, 8, 2, 3, 9, 2, 5, 10, 2, 11, 2, 3, 4, 6, 12, 2, 4, 13, 2, 4, 7, 14, 2, 3, 4, 5, 15, 2, 3, 4, 8, 16, 2, 3, 17, 2, 3, 6, 9, 18, 2, 3, 19, 2, 3, 4, 5, 10, 20, 2, 3, 5, 7, 21, 2, 3, 5, 11, 22, 2, 3, 5, 23, 2, 3, 4, 5, 6, 8, 12, 24
Offset: 1

Author

Devansh Singh, Sep 03 2020

Keywords

Comments

If a number n has base 'b' representation = (... (b-1) A(j-1) ...A(3) A(2) A(1) A(0)) contains digit b-1, where b = q*(k+1)/k, k>=1 , and Sum_{i>=0} ((A(i)(mod b-q))*((b-q)^i)) > 0 then there exists n' < n such that that n' in base b-q = b' contains digit b'-1 at the same place as n in base b and 0 <= (A(i)-A'(i))/b' <= (k+1)-((A'(i)+1)/b') (A'(i) is digit of n' in base b')for all i>=0.*
This condition is necessary and sufficient.
Proof that Condition is Necessary:
Since b-1 = b-q+q-1 and b' = q/k (as b = q*(k+1)/k). Therefore (b-1) (mod b') = (b'+q-1) (mod b') = (q-1) (mod b') = b'-1 :-(1).
n in base 'b' representation = (... (b-1) A(j-1) ...A(3) A(2) A(1) A(0)).Then n = Sum_{i>=0} (A(i)*(b^i)) = Sum_{i>=0} (A(i)*((b-q+q)^i)).
n = Sum_{i>=0} (A(i)*(b'^i)) +
Sum_{i>=1} (A(i)*(b^i - b'^i))
= Sum_{i>=0} (A'(i)*(b'^i)) + Sum_{i>=0} ((A(i)-A'(i))* (b'^i)) + Sum_{i>=1} (A(i)*(b^i - b'^i)),
where A'(i) = A(i) (mod b').
Now n-Sum_{i>=0} ((A(i)-A'(i))*(b'^i))
- Sum_{i>=1} (A(i)*(b^i - b'^i))
= Sum_{i>=0} (A'(i)*(b'^i)).
Since A'(j) = A(j) (mod b') = (b-1) (mod b') = b'-1(due to equation (1) above and A(j) = b-1.
Hence there exists n' = Sum_{i>=0} (A'(i)*(b'^i)) > 0 containing digit b'-1 in base b'.
Table of n/b with cell containing T(n, b) = (n', b') for q = b/2. n' = Sum_{i>=0} (A'(i)*(b'^i))
n/b| 4 | 6 | 8 | 10 | 12
3 |(1,2)| | | |
4 | | | | |
5 | |(2,3)| | |
6 | | | | |
7 |(3,2)| |(3,4)| |
8 | | | | |
9 | | | |(4,5)|
10 | | | | |
11 |(1,2)|(5,3)| | |(5,6)
Example: For table n/b in comments containing (n',b') in its cells.
For n = 7:
In base b = 4, n = 13 :- q = b' = 4/2 = 2, and n' = (3 mod (2))*(2)^0 + (1 mod(2))*(2)^1 = 1+2 = 3.
In base b = 8, n = 7 :- q = b' = 8/2 = 4, and n' = (7 mod (4))*(4)^0 = 3.
There are no other bases b >= 4 except 4, 8 for n = 7.
(n, b) maps to (0, 1) if b is prime. Following this and comment in A337536 we can say that all of the terms of A337536 will map to (0, 1) only, except A337536(2).
For above (n, b) -> (n', b') one possible (n, b) pair for (n', b') is { Sum_{i>=0} ((A'(i)+b') *((2*b')^i)), 2*b'}.

Examples

			Triangle begins
  Row    Bases
  n=1:   2
  n=2:   2  3
  n=3:   2  4
  n=4:   2  5
  n=5:   2  3  6
  n=6:   2  3  7
  n=7:   2  3  4  8
  n=8:   2  3  9
  n=9:   2  5  10
  n=10:  2  11
		

Crossrefs

Cf. A337535 (second column), A338295 (penultimate column), A337496 (row widths), A337536 (width 2), A337143 (width 3).
Rows containing bases 3..11 respectively: A074940, A337250, A337572, A333656, A337141, A337239, A338090, A011539, A095778.

Programs

  • PARI
    row(n) = {my(list = List()); for (b=2, n+1, if (vecmax(digits(n, b)) == b-1, listput(list, b));); Vec(list);} \\ Michel Marcus, Sep 11 2020

Extensions

More terms from Michel Marcus, Sep 11 2020

A337355 a(n) is the denominator of Product_{i=0..n-1} (n-i)^((-1)^ceiling(i/2)).

Original entry on oeis.org

1, 1, 2, 3, 6, 5, 5, 63, 56, 4, 225, 77, 1232, 312, 65, 2695, 1408, 14144, 9945, 92169, 53504, 28288, 41769, 370139, 447488, 217600, 502775, 1427679, 2684928, 2524160, 10414625, 132774147, 443908096, 2375680, 1168520925, 3129357, 18644140032, 35160064, 1108596775, 2318853537
Offset: 1

Author

Devansh Singh, Aug 24 2020

Keywords

Examples

			a(5) = denominator of (5*2)/(4*3) = 6.
		

Crossrefs

Cf. A337354 (numerators).

Programs

  • PARI
    a(n) = {denominator(prod(i=0, n-1, (n-i)^(-1)^((i+1)\2)))} \\ Andrew Howroyd, Aug 25 2020

Extensions

Terms a(31) and beyond from Andrew Howroyd, Aug 25 2020

A337354 a(n) is the numerator of Product_{i=0..n-1} (n-i)^((-1)^ceiling(i/2)).

Original entry on oeis.org

1, 2, 3, 2, 5, 9, 7, 40, 45, 7, 308, 48, 975, 539, 88, 1664, 1105, 24255, 13376, 56576, 41769, 48279, 55936, 226304, 348075, 370139, 671232, 870400, 2082925, 4283037, 13872128, 80773120, 343682625, 4023459, 1553678336, 1900544, 14411758075, 59457783, 1471905792, 1406402560
Offset: 1

Author

Devansh Singh, Aug 24 2020

Keywords

Comments

a(n) is the numerator of (n/(n-1)) * ((n-3)/(n-2)) * ((n-4)/(n-5)) ...

Examples

			a(n)/A337355(n) equals 1, 2, 3/2, 2/3, 5/6, 9/5, 7/5, 40/63, 45/56, 7/4 ...
a(4) = numerator of (4*1)/(3*2) = numerator of 2/3 = 2.
a(5) = numerator of (5*2)/(4*3) = numerator of 5/6 = 5.
                      12  *   9*8  *  5*4  *  1
a(12) = numerator of --------------------------- = 48.
                        11*10  *  7*6  *  3*2
		

Crossrefs

Cf. A337355 (denominators).

Programs

  • PARI
    a(n) = {numerator(prod(i=0, n-1, (n-i)^(-1)^((i+1)\2)))} \\ Andrew Howroyd, Aug 24 2020

Formula

a(n) = numerator of (n*A337355(n-2))/(a(n-2)*(n-1)) for n>=3.
Conjecture: a(4*n)/A337355(4*n) ~ 0.5990701173677... (=A076390). - Andrew Howroyd, Aug 25 2020

Extensions

Terms a(31) and beyond from Andrew Howroyd, Aug 25 2020