Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

130
Visualizações
How to code the complete OEIS sequence A127824? VBA

I am coding the sequence as described at A127824 using VBA. I am incorporating the logic from a Java code at Java. My code is:

Sub A127824()

    Dim i, n, m

    n = 0
    i = 0

    Do While i <= 12

        If n = 0 Then
            Debug.Print i, 1
            n = n + 1
            i = i + 1
            GoTo x1
        Else
x1:
            If (n - 4) Mod 6 <> 0 Then
                Debug.Print i, 2 * n
                n = 2 * n
                i = i + 1
                If i > 12 Then Exit Sub
                GoTo x1
            Else
                If (n - 1) / 3 <> 1 Then
                    Debug.Print i, (n - 1) / 3, 2 * n
                    n = (n - 1) / 3
                    m = 2 * n
                    i = i + 1
                    If i > 12 Then Exit Sub
                Else
                    Debug.Print i, 2 * n
                    n = 2 * n
                    i = i + 1
                    If i > 12 Then Exit Sub
                    GoTo x1:
                End If

            End If

        End If
    Loop

End Sub

But, my output table is partial as compared to the table at the OIES link under "EXAMPLE."

Seeking help to output the missing elements. I believe a recursion is needed but I have not been able to work it out.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda