[seqfan] Re: ***SPAM*** Occurrences of a(n-1)

Robert FERREOL robert.ferreol at gmail.com
Mon Oct 7 15:53:38 CEST 2019


Le 29/09/2019 à 08:11, Ali Sada via SeqFan a écrit :
> Hi Everyone,
>
>
> I am studying the sequencesbelow. They count the occurrences of a(n-1.) Each sequence starts with a natural number(m.)
>
>   
>
> If we start with a(1)=1 we get:
>
> 1,1,2,1,3,1,4,1,5,1,6,….
>
>
> Each sequencebecomes “periodic” at n=1+m^2. The period is 2m long, and we can find its termswith a simple mod function.
>
>   
> I put these sequences in an array, where each column is a sequence starting with 1,2,3,…etc.
>
> https://justpaste.it/6eu84
>
>   
> I would really appreciate it if you could recommend any materials about this array.

More precisely,  a(m**2+1+2*m*k)=m,  a(m**2+1+2*m*k+2*q)=q  , 
a(m**2+1+2*m*k+2*q+1)=m+k+1.

A python program (my sequence begin with a(0)=1 , not a(1)=1, python 
prefers)


import numpy as np

N=100

T=np.zeros((N+1,N+1),int)

for i in range(N+1):

     T[i,0]=i

     for n in range(1,N+1):

         L=[T[i,j] for j in range(n)]

         T[i,n]=L.count(T[i,n-1])

T


As a function, valid for n>=m**2 :


def a(m,n):

      k=(n-m**2)//(2*n0);r=(n-m**2)%(2*m)

      q=r//2;s=r%2

      if s==1:

          return(m+k+1)

      else:

          if q==0:

              return(m)

          else:

              return(q)



-- 

ROBERT FERRÉOL
6, Rue des Annelets 75019 PARIS
01 42 41 91 98
http://mapage.noos.fr/r.ferreol
https://www.facebook.com/mathcurve
maths, ex mpsi Fénelon Paris




More information about the SeqFan mailing list